Home / Function/ Test_Proxy_Forward_Local_Client() — fiber Function Reference

Test_Proxy_Forward_Local_Client() — fiber Function Reference

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

Entity Profile

Dependency Diagram

graph TD
  ca79e0cf_7a40_0504_6416_9c9d07ef8e1c["Test_Proxy_Forward_Local_Client()"]
  a7c70172_e40a_6ad6_65b6_b8f508cfb0a2["proxy_test.go"]
  ca79e0cf_7a40_0504_6416_9c9d07ef8e1c -->|defined in| a7c70172_e40a_6ad6_65b6_b8f508cfb0a2
  fc2b6784_0dfb_d6e2_4148_406d442e8019["startServer()"]
  ca79e0cf_7a40_0504_6416_9c9d07ef8e1c -->|calls| fc2b6784_0dfb_d6e2_4148_406d442e8019
  style ca79e0cf_7a40_0504_6416_9c9d07ef8e1c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

middleware/proxy/proxy_test.go lines 763–787

func Test_Proxy_Forward_Local_Client(t *testing.T) {
	t.Parallel()
	ln, err := net.Listen(fiber.NetworkTCP4, "127.0.0.1:0")
	require.NoError(t, err)
	app := fiber.New()
	app.Get("/test_local_client", func(c fiber.Ctx) error {
		return c.SendString("test_local_client")
	})

	addr := ln.Addr().String()
	app.Use(Forward("http://"+addr+"/test_local_client", &fasthttp.Client{
		NoDefaultUserAgentHeader: true,
		DisablePathNormalizing:   true,

		Dial: fasthttp.Dial,
	}))
	startServer(app, ln)

	client := clientpkg.New()
	resp, err := client.Get("http://" + addr)
	require.NoError(t, err)
	require.Equal(t, fiber.StatusOK, resp.StatusCode())
	require.Equal(t, "test_local_client", string(resp.Body()))
	resp.Close()
}

Domain

Subdomains

Frequently Asked Questions

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

Analyze Your Own Codebase

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

Try Supermodel Free