Home / Function/ Test_Proxy_Forward_WithClient_TLSConfig() — fiber Function Reference

Test_Proxy_Forward_WithClient_TLSConfig() — fiber Function Reference

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

Entity Profile

Dependency Diagram

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

Relationship Graph

Source Code

middleware/proxy/proxy_test.go lines 334–370

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

	serverTLSConf, _, err := tlstest.GetTLSConfigs()
	require.NoError(t, err)

	ln, err := net.Listen(fiber.NetworkTCP4, "127.0.0.1:0")
	require.NoError(t, err)

	ln = tls.NewListener(ln, serverTLSConf)

	app := fiber.New()

	app.Get("/tlsfwd", func(c fiber.Ctx) error {
		return c.SendString("tls forward")
	})

	addr := ln.Addr().String()
	clientTLSConf := &tls.Config{InsecureSkipVerify: true} //nolint:gosec // We're in a test func, so this is fine

	// disable certificate verification
	WithClient(&fasthttp.Client{
		TLSConfig: clientTLSConf,
	})
	app.Use(Forward("https://" + addr + "/tlsfwd"))

	startServer(app, ln)

	client := clientpkg.New()
	client.SetTLSConfig(clientTLSConf)

	resp, err := client.Get("https://" + addr)
	require.NoError(t, err)
	require.Equal(t, fiber.StatusOK, resp.StatusCode())
	require.Equal(t, "tls forward", string(resp.Body()))
	resp.Close()
}

Domain

Subdomains

Frequently Asked Questions

What does Test_Proxy_Forward_WithClient_TLSConfig() do?
Test_Proxy_Forward_WithClient_TLSConfig() is a function in the fiber codebase, defined in middleware/proxy/proxy_test.go.
Where is Test_Proxy_Forward_WithClient_TLSConfig() defined?
Test_Proxy_Forward_WithClient_TLSConfig() is defined in middleware/proxy/proxy_test.go at line 334.
What does Test_Proxy_Forward_WithClient_TLSConfig() call?
Test_Proxy_Forward_WithClient_TLSConfig() 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