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) SetMaxConnsPerHost(max int)
- func (m *Manager) SetPreset(preset *fingerprint.Preset)
- func (m *Manager) Stats() map[string]struct{ ... }
- type QUICConn
- type QUICHostPool
- type QUICManager
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
func NewHostPoolWithConfig ¶
func NewHostPoolWithConfig(host, port string, preset *fingerprint.Preset, dnsCache *dns.Cache, insecureSkipVerify bool, proxyURL string) *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) 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 (*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) SetMaxConnsPerHost ¶
func (m *QUICManager) SetMaxConnsPerHost(max int)
SetMaxConnsPerHost sets the max connections per host for new pools (0 = unlimited)