Documentation
¶
Index ¶
- Variables
- type Conn
- type HostPool
- type Manager
- func (m *Manager) Close()
- func (m *Manager) GetConn(ctx context.Context, host, port string) (*Conn, error)
- func (m *Manager) GetDNSCache() *dns.Cache
- func (m *Manager) GetPool(host, port string) (*HostPool, error)
- func (m *Manager) SetConnectTo(requestHost, connectHost string)
- func (m *Manager) SetECHConfig(echConfig []byte)
- func (m *Manager) SetECHConfigDomain(domain string)
- func (m *Manager) SetMaxConnsPerHost(max int)
- func (m *Manager) SetPreset(preset *fingerprint.Preset)
- func (m *Manager) Stats() map[string]struct{ ... }
- type QUICConn
- type QUICHostPool
- type QUICManager
- func (m *QUICManager) Close()
- func (m *QUICManager) GetConn(ctx context.Context, host, port string) (*QUICConn, error)
- func (m *QUICManager) GetPool(host, port string) (*QUICHostPool, error)
- func (m *QUICManager) SetConnectTo(requestHost, connectHost string)
- func (m *QUICManager) SetECHConfig(echConfig []byte)
- func (m *QUICManager) SetECHConfigDomain(domain string)
- func (m *QUICManager) SetMaxConnsPerHost(max int)
- func (m *QUICManager) Stats() map[string]struct{ ... }
Constants ¶
This section is empty.
Variables ¶
var ( ErrPoolClosed = errors.New("connection pool is closed") ErrNoConnections = errors.New("no available connections") )
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn struct {
Host string
RemoteAddr net.Addr
TLSConn *utls.UConn
HTTP2Conn *http2.ClientConn
CreatedAt time.Time
LastUsedAt time.Time
UseCount int64
// contains filtered or unexported fields
}
Conn represents a persistent connection
type HostPool ¶
type HostPool struct {
// contains filtered or unexported fields
}
HostPool manages connections to a single host
func NewHostPool ¶
NewHostPool creates a new pool for a specific host Note: This generates its own shuffled specs. For consistent session fingerprinting, use Manager.GetPool() instead which shares cached specs across all hosts.
func NewHostPoolWithConfig ¶
func NewHostPoolWithConfig(host, port string, preset *fingerprint.Preset, dnsCache *dns.Cache, insecureSkipVerify bool, proxyURL string, cachedSpec, cachedPSKSpec *utls.ClientHelloSpec) *HostPool
NewHostPoolWithConfig creates a pool with TLS and proxy configuration
func (*HostPool) CloseIdle ¶
func (p *HostPool) CloseIdle()
CloseIdle closes connections that have been idle too long
func (*HostPool) SetMaxConns ¶
SetMaxConns sets the maximum connections for this pool (0 = unlimited)
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages connection pools for multiple hosts
func NewManager ¶
func NewManager(preset *fingerprint.Preset) *Manager
NewManager creates a new connection pool manager
func NewManagerWithProxy ¶
func NewManagerWithProxy(preset *fingerprint.Preset, proxyURL string, insecureSkipVerify bool) *Manager
NewManagerWithProxy creates a manager with proxy support
func NewManagerWithTLSConfig ¶
func NewManagerWithTLSConfig(preset *fingerprint.Preset, insecureSkipVerify bool) *Manager
NewManagerWithTLSConfig creates a manager with TLS configuration
func (*Manager) GetDNSCache ¶
GetDNSCache returns the DNS cache
func (*Manager) SetConnectTo ¶ added in v1.5.2
SetConnectTo sets a host mapping for domain fronting
func (*Manager) SetECHConfig ¶ added in v1.5.2
SetECHConfig sets a custom ECH configuration
func (*Manager) SetECHConfigDomain ¶ added in v1.5.2
SetECHConfigDomain sets a domain to fetch ECH config from
func (*Manager) SetMaxConnsPerHost ¶
SetMaxConnsPerHost sets the max connections per host for new pools (0 = unlimited)
func (*Manager) SetPreset ¶
func (m *Manager) SetPreset(preset *fingerprint.Preset)
SetPreset changes the fingerprint preset for new connections
type QUICConn ¶
type QUICConn struct {
Host string
RemoteAddr net.Addr
QUICConn *quic.Conn
HTTP3RT *http3.Transport
CreatedAt time.Time
LastUsedAt time.Time
UseCount int64
// contains filtered or unexported fields
}
QUICConn represents a persistent QUIC connection
type QUICHostPool ¶
type QUICHostPool struct {
// contains filtered or unexported fields
}
QUICHostPool manages QUIC connections to a single host
func NewQUICHostPool ¶
func NewQUICHostPool(host, port string, preset *fingerprint.Preset, dnsCache *dns.Cache) *QUICHostPool
NewQUICHostPool creates a new QUIC pool for a specific host
func NewQUICHostPoolWithCachedSpec ¶ added in v1.1.4
func NewQUICHostPoolWithCachedSpec(host, port string, preset *fingerprint.Preset, dnsCache *dns.Cache, cachedSpec *utls.ClientHelloSpec, shuffleSeed int64) *QUICHostPool
NewQUICHostPoolWithCachedSpec creates a QUIC pool with a pre-cached ClientHelloSpec and shuffle seed This ensures consistent TLS extension order and transport parameter order across all hosts in a session
func (*QUICHostPool) Close ¶
func (p *QUICHostPool) Close()
Close closes all connections in the pool
func (*QUICHostPool) CloseIdle ¶
func (p *QUICHostPool) CloseIdle()
CloseIdle closes connections that have been idle too long
func (*QUICHostPool) GetConn ¶
func (p *QUICHostPool) GetConn(ctx context.Context) (*QUICConn, error)
GetConn returns an available QUIC connection or creates a new one
func (*QUICHostPool) SetMaxConns ¶
func (p *QUICHostPool) SetMaxConns(max int)
SetMaxConns sets the maximum connections for this pool (0 = unlimited)
type QUICManager ¶
type QUICManager struct {
// contains filtered or unexported fields
}
QUICManager manages QUIC connection pools for multiple hosts
func NewQUICManager ¶
func NewQUICManager(preset *fingerprint.Preset, dnsCache *dns.Cache) *QUICManager
NewQUICManager creates a new QUIC connection pool manager
func (*QUICManager) Close ¶
func (m *QUICManager) Close()
Close shuts down the manager and all pools
func (*QUICManager) GetPool ¶
func (m *QUICManager) GetPool(host, port string) (*QUICHostPool, error)
GetPool returns a pool for the given host, creating one if needed
func (*QUICManager) SetConnectTo ¶ added in v1.5.2
func (m *QUICManager) SetConnectTo(requestHost, connectHost string)
SetConnectTo sets a host mapping for domain fronting
func (*QUICManager) SetECHConfig ¶ added in v1.5.2
func (m *QUICManager) SetECHConfig(echConfig []byte)
SetECHConfig sets a custom ECH configuration
func (*QUICManager) SetECHConfigDomain ¶ added in v1.5.2
func (m *QUICManager) SetECHConfigDomain(domain string)
SetECHConfigDomain sets a domain to fetch ECH config from
func (*QUICManager) SetMaxConnsPerHost ¶
func (m *QUICManager) SetMaxConnsPerHost(max int)
SetMaxConnsPerHost sets the max connections per host for new pools (0 = unlimited)