test

package
v1.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 3, 2026 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserAgents = map[string]string{
	"Chrome":  "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/133.0.0.0 Safari/537.36",
	"Firefox": "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:120.0) Gecko/20100101 Firefox/120.0",
	"Safari":  "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.1 Safari/605.1.15",
	"Edge":    "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36 Edg/85.0.564.70",
}

UserAgents for testing different browser fingerprints with distinct versions

Functions

func CreateDirectClient

func CreateDirectClient() *http.Client

CreateDirectClient creates a direct HTTP client (no proxy) with HTTP/2 support

func CreateProxyClient

func CreateProxyClient(proxyPort string, userAgent string) (*http.Client, error)

CreateProxyClient creates an HTTP client configured to use the proxy

func CreateTCPConnection

func CreateTCPConnection(proxyPort, target string) (net.Conn, error)

CreateTCPConnection creates a raw TCP connection for CONNECT testing

Types

type TestServer

type TestServer struct {
	HTTPServer         *http.Server
	HTTPSServer        *http.Server
	WebSocketServer    *http.Server // HTTP WebSocket server
	WebSocketSSLServer *http.Server // HTTPS WebSocket server
	HTTPPort           string
	HTTPSPort          string
	WebSocketPort      string
	WebSocketSSLPort   string
}

TestServer holds test server instances

func NewTestServer

func NewTestServer(httpPort, httpsPort, wsPort, wssPort string) *TestServer

NewTestServer creates test servers for HTTP, HTTPS, and WebSocket

func (*TestServer) Start

func (ts *TestServer) Start() error

Start starts all test servers

func (*TestServer) Stop

func (ts *TestServer) Stop()

Stop stops all test servers

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL