Home / File/ proxy_test.go — fiber Source File

proxy_test.go — fiber Source File

Architecture documentation for proxy_test.go, a go file in the fiber codebase. 1 imports, 0 dependents.

File go FiberCore Adapters 1 imports 39 functions 1 classes

Entity Profile

Dependency Diagram

graph LR
  a7c70172_e40a_6ad6_65b6_b8f508cfb0a2["proxy_test.go"]
  633f63d7_c731_5dad_c6ed_c9824feba192["tls"]
  a7c70172_e40a_6ad6_65b6_b8f508cfb0a2 --> 633f63d7_c731_5dad_c6ed_c9824feba192
  style a7c70172_e40a_6ad6_65b6_b8f508cfb0a2 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

package proxy

import (
	"crypto/tls"
	"io"
	"net"
	"net/http"
	"net/http/httptest"
	"os"
	"strings"
	"testing"
	"time"

	"github.com/gofiber/fiber/v3"
	clientpkg "github.com/gofiber/fiber/v3/client"
	"github.com/stretchr/testify/require"

	"github.com/gofiber/fiber/v3/internal/tlstest"
	"github.com/valyala/fasthttp"
)

func startServer(app *fiber.App, ln net.Listener) {
	go func() {
		err := app.Listener(ln, fiber.ListenConfig{
			DisableStartupMessage: true,
		})
		if err != nil {
			panic(err)
		}
	}()
}

func createProxyTestServer(t *testing.T, handler fiber.Handler, network, address string) (target *fiber.App, addr string) { //nolint:nonamedreturns // gocritic unnamedResult prefers naming returned target app and address for readability
	t.Helper()

	target = fiber.New()
	target.Get("/", handler)

	ln, err := net.Listen(network, address)
	require.NoError(t, err)

	addr = ln.Addr().String()

	startServer(target, ln)

	return target, addr
}

func createProxyTestServerIPv4(t *testing.T, handler fiber.Handler) (target *fiber.App, addr string) { //nolint:nonamedreturns // gocritic unnamedResult prefers naming returned target app and address for readability
	t.Helper()
	return createProxyTestServer(t, handler, fiber.NetworkTCP4, "127.0.0.1:0")
}

func createProxyTestServerIPv6(t *testing.T, handler fiber.Handler) (target *fiber.App, addr string) { //nolint:nonamedreturns // gocritic unnamedResult prefers naming returned target app and address for readability
	t.Helper()
	return createProxyTestServer(t, handler, fiber.NetworkTCP6, "[::1]:0")
}

func createRedirectServer(t *testing.T) string {
	t.Helper()
// ... (886 more lines)

Domain

Subdomains

Classes

Dependencies

  • tls

Frequently Asked Questions

What does proxy_test.go do?
proxy_test.go is a source file in the fiber codebase, written in go. It belongs to the FiberCore domain, Adapters subdomain.
What functions are defined in proxy_test.go?
proxy_test.go defines 39 function(s): Test_Proxy, Test_ProxyBalancer_Custom_Client, Test_Proxy_Balancer_Forward_Local, Test_Proxy_Balancer_IPv4_Upstream_With_DialDualStack, Test_Proxy_Balancer_IPv6_Upstream, Test_Proxy_Balancer_IPv6_Upstream_With_DialDualStack, Test_Proxy_Balancer_WithTlsConfig, Test_Proxy_Buffer_Size_Response, Test_Proxy_DoDeadline_PastDeadline, Test_Proxy_DoDeadline_RestoreOriginalURL, and 29 more.
What does proxy_test.go depend on?
proxy_test.go imports 1 module(s): tls.
Where is proxy_test.go in the architecture?
proxy_test.go is located at middleware/proxy/proxy_test.go (domain: FiberCore, subdomain: Adapters, directory: middleware/proxy).

Analyze Your Own Codebase

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

Try Supermodel Free