Documentation
¶
Overview ¶
Package transport provides an HTTP transport layer with TLS fingerprint spoofing. It implements http.RoundTripper and supports both HTTP/1.1 and HTTP/2 with configurable browser profiles for TLS and HTTP/2 fingerprinting.
Index ¶
Constants ¶
const HeaderOrderKey = http.HeaderOrderKey
HeaderOrderKey is a magic key for http.Header that specifies the order in which HTTP/1.1 headers should be written. Re-exported from internal/fork/http.
const PHeaderOrderKey = http.PHeaderOrderKey
PHeaderOrderKey is a magic key for http.Header that specifies the order of HTTP/2 pseudo-headers. Re-exported from internal/fork/http.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct {
Method string
Host string
Path string
Headers map[string]string
Body io.Reader // Streaming body - no buffering/copying
}
Request represents an HTTP request for the transport.
type Response ¶
type Response struct {
Status int
StatusCode int // Alias for Status (http.Response compatibility)
Proto string // Protocol version (e.g., "HTTP/2.0")
Headers http.Header // Response headers
Body io.ReadCloser // Response body
ContentLen int64 // Content length (-1 if unknown)
}
Response wraps an HTTP response.
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport implements http.RoundTripper with TLS fingerprinting.
func Chrome143Transport ¶
func Chrome143Transport() *Transport
Chrome143Transport returns a transport configured for Chrome 143.
func Firefox146Transport ¶
func Firefox146Transport() *Transport
Firefox146Transport returns a transport configured for Firefox 146.
func NewTransport ¶
func NewTransport(cfg TransportConfig) *Transport
NewTransport creates a new transport with the given configuration.
func Safari261Transport ¶
func Safari261Transport() *Transport
Safari261Transport returns a transport configured for Safari 26.1.
type TransportConfig ¶
type TransportConfig struct {
Profile *profile.BrowserProfile
MaxConnsPerHost int
IdleTimeout time.Duration
Timeout time.Duration
Proxy *htls.ProxyConfig
DNSCache *dns.Cache // Optional DNS cache for faster repeated lookups
InsecureSkipVerify bool // Skip TLS certificate verification (testing only)
ForceHTTP1 bool // Force HTTP/1.1 instead of HTTP/2 (higher throughput, less fingerprint control)
EnableHTTP3 bool // Enable HTTP/3 with auto-fallback to HTTP/2
HeaderOrder []string // HTTP header order (overrides browser profile if set)
PseudoHeaderOrder []string // HTTP/2 pseudo-header order (overrides browser profile if set)
}
TransportConfig holds transport configuration.
func DefaultTransportConfig ¶
func DefaultTransportConfig() TransportConfig
DefaultTransportConfig returns sensible defaults.