proxy_test.go — fiber Source File
Architecture documentation for proxy_test.go, a go file in the fiber codebase. 1 imports, 0 dependents.
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
Functions
- 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()
- Test_Proxy_DoRedirects_RestoreOriginalURL()
- Test_Proxy_DoRedirects_TooManyRedirects()
- Test_Proxy_DoTimeout_RestoreOriginalURL()
- Test_Proxy_DoTimeout_Timeout()
- Test_Proxy_Do_HTTP_Prefix_URL()
- Test_Proxy_Do_RestoreOriginalURL()
- Test_Proxy_Do_WithRealURL()
- Test_Proxy_Do_WithRedirect()
- Test_Proxy_Domain_Forward_Local()
- Test_Proxy_DropConnectionHeader()
- Test_Proxy_Empty_Config()
- Test_Proxy_Empty_Upstream_Servers()
- Test_Proxy_Forward()
- Test_Proxy_Forward_Global_Client()
- Test_Proxy_Forward_Local_Client()
- Test_Proxy_Forward_WithClient_TLSConfig()
- Test_Proxy_Forward_WithTlsConfig_To_Http()
- Test_Proxy_Immutable()
- Test_Proxy_KeepConnectionHeader()
- Test_Proxy_Modify_Request()
- Test_Proxy_Modify_Response()
- Test_Proxy_Next()
- Test_Proxy_Timeout_Slow_Server()
- Test_Proxy_With_Timeout()
- createProxyTestServer()
- createProxyTestServerIPv4()
- createProxyTestServerIPv6()
- createRedirectServer()
- startServer()
Classes
Dependencies
- tls
Source
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