Home / Function/ Test_Proxy() — fiber Function Reference

Test_Proxy() — fiber Function Reference

Architecture documentation for the Test_Proxy() function in proxy_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  b743a6e9_3fea_938e_4f37_7b6904f71e0c["Test_Proxy()"]
  a7c70172_e40a_6ad6_65b6_b8f508cfb0a2["proxy_test.go"]
  b743a6e9_3fea_938e_4f37_7b6904f71e0c -->|defined in| a7c70172_e40a_6ad6_65b6_b8f508cfb0a2
  52270b9b_26c8_081b_5239_bee723ca512a["createProxyTestServerIPv4()"]
  b743a6e9_3fea_938e_4f37_7b6904f71e0c -->|calls| 52270b9b_26c8_081b_5239_bee723ca512a
  style b743a6e9_3fea_938e_4f37_7b6904f71e0c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/proxy/proxy_test.go lines 132–155

func Test_Proxy(t *testing.T) {
	t.Parallel()

	target, addr := createProxyTestServerIPv4(t, func(c fiber.Ctx) error {
		return c.SendStatus(fiber.StatusTeapot)
	})

	resp, err := target.Test(httptest.NewRequest(fiber.MethodGet, "/", http.NoBody), fiber.TestConfig{
		Timeout:       2 * time.Second,
		FailOnTimeout: true,
	})
	require.NoError(t, err)
	require.Equal(t, fiber.StatusTeapot, resp.StatusCode)

	app := fiber.New()

	app.Use(Balancer(Config{Servers: []string{addr}}))

	req := httptest.NewRequest(fiber.MethodGet, "/", http.NoBody)
	req.Host = addr
	resp, err = app.Test(req)
	require.NoError(t, err)
	require.Equal(t, fiber.StatusTeapot, resp.StatusCode)
}

Domain

Subdomains

Frequently Asked Questions

What does Test_Proxy() do?
Test_Proxy() is a function in the fiber codebase, defined in middleware/proxy/proxy_test.go.
Where is Test_Proxy() defined?
Test_Proxy() is defined in middleware/proxy/proxy_test.go at line 132.
What does Test_Proxy() call?
Test_Proxy() calls 1 function(s): createProxyTestServerIPv4.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free