Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewClient ¶
func NewClient(config *Config) (Client, *HandshakeInfo, error)
NewClient 创建并返回一个新的 Client 实例。
func SimulateWebBrowse ¶ added in v0.1.0
SimulateWebBrowse requests /index.html from the decoy site, parses all linked resources (src/href), and returns a list of absolute URLs (in order). If a link is a relative path (starts with /), it will be joined with decoyBaseURL.
Types ¶
type BandwidthConfig ¶
BandwidthConfig describes the maximum bandwidth that the server can use, in bytes per second.
type Client ¶
func NewReconnectableClient ¶
func NewReconnectableClient(configFunc func() (*Config, error), connectedFunc func(Client, *HandshakeInfo, int), lazy bool) (Client, error)
NewReconnectableClient creates a reconnectable client. If lazy is true, the client will not connect until the first call to TCP() or UDP(). We use a function for config mainly to delay config evaluation (which involves DNS resolution) until the actual connection attempt.
type Config ¶
type Config struct { ConnFactory ConnFactory ServerAddr net.Addr Auth string TLSConfig TLSConfig QUICConfig QUICConfig BandwidthConfig BandwidthConfig FastOpen bool DecoyURL string Protocol ProtocolType ProtocolParam string EnableUQUIC bool UQUICSpecID quic.QUICID // 类型必须为 quic.QUICID // Add this new field to enable FakeTCP XLESSUseFakeTCP bool `json:"xless_use_faketcp,omitempty"` WebsimCount int // 新增:指定 Websim 请求的资源个数 // contains filtered or unexported fields }
type ConnFactory ¶
type ConnFactory interface {
New(net.Addr) (net.PacketConn, error)
}
type HandshakeInfo ¶
type ProtocolType ¶ added in v0.3.2
type ProtocolType string
ProtocolType 定义了客户端支持的协议类型
const ( ProtocolTypeDefault ProtocolType = "default" // 默认协议类型 ProtocolTypeAuthA ProtocolType = "auth_a" )
type QUICConfig ¶
type QUICConfig struct { InitialStreamReceiveWindow uint64 MaxStreamReceiveWindow uint64 InitialConnectionReceiveWindow uint64 MaxConnectionReceiveWindow uint64 MaxIdleTimeout time.Duration KeepAlivePeriod time.Duration DisablePathMTUDiscovery bool }
QUICConfig contains the QUIC configuration fields that we want to expose to the user.