options

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultGrpcOptions = &GrpcOptions{
	TlsOptions: TlsOptions{Mode: None},
}
View Source
var DefaultKcpOptions = &KcpOptions{
	Crypt:       "none",
	Key:         "",
	Mode:        "normal",
	Mtu:         1350,
	SndWnd:      2048,
	RevWnd:      2048,
	DataShard:   10,
	ParityShard: 3,
	Dscp:        46,
	Resend:      2,
	NoCompress:  true,
	AckNoDelay:  false,
	Interval:    40,
	Nc:          1,
	SockBuf:     16777217,
	SmuxVer:     1,
	SmuxBuf:     16777217,
	StreamBuf:   2097152,
	KeepAlive:   10,
	Conns:       3,
}
View Source
var DefaultObfsOptions = &ObfsOptions{
	Host: "www.baidu.com",
}
View Source
var DefaultOptions = &defaultOptions{}
View Source
var DefaultQuicOptions = &QuicOptions{
	HandshakeIdleTimeout: 5 * time.Second,
	KeepAlivePeriod:      30 * time.Second,
	MaxIdleTimeout:       30 * time.Second,
	Conns:                3,
}
View Source
var DefaultWsOptions = &WsOptions{
	Host:       "www.baidu.com",
	Path:       "/ws",
	SndBuffer:  4096,
	RevBuffer:  4096,
	Compress:   false,
	TlsOptions: TlsOptions{Mode: None},
	UserAgent:  "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36",
}

Functions

This section is empty.

Types

type GrpcOptions

type GrpcOptions struct {
	TlsOptions
	SndBuffer int
	RevBuffer int
}

func (*GrpcOptions) Update

func (opts *GrpcOptions) Update()

type KcpOptions

type KcpOptions struct {
	Key         string
	Crypt       string
	Mode        string
	Mtu         int
	SndWnd      int
	RevWnd      int
	DataShard   int
	ParityShard int
	Dscp        int
	NoCompress  bool
	AckNoDelay  bool
	NoDelay     int
	Interval    int
	Resend      int
	Nc          int
	SockBuf     int
	SmuxVer     int
	SmuxBuf     int
	StreamBuf   int
	KeepAlive   int
	Conns       int

	BC kcp.BlockCrypt
}

func (*KcpOptions) Update

func (opts *KcpOptions) Update()

type ObfsOptions

type ObfsOptions struct {
	Host string
}

func (*ObfsOptions) Update

func (opts *ObfsOptions) Update()

type Options

type Options interface{ Update() }

type QuicOptions

type QuicOptions struct {
	TlsOptions
	HandshakeIdleTimeout time.Duration
	KeepAlivePeriod      time.Duration
	MaxIdleTimeout       time.Duration
	Conns                int
}

func (*QuicOptions) Update

func (opts *QuicOptions) Update()

type TlsMode

type TlsMode byte
const (
	None TlsMode = iota
	TLS
	MTLS
)

type TlsOptions

type TlsOptions struct {
	Mode     TlsMode
	CAFile   string
	KeyFile  string // server or client key file
	CertFile string // server or client cert file
	Hostname string
}

func (*TlsOptions) GetClientTlsConfig

func (o *TlsOptions) GetClientTlsConfig() (*tls.Config, error)

func (*TlsOptions) GetServerTlsConfig

func (o *TlsOptions) GetServerTlsConfig() (*tls.Config, error)

type WsOptions

type WsOptions struct {
	TlsOptions
	Host      string
	Path      string
	SndBuffer int
	RevBuffer int
	Compress  bool
	UserAgent string
}

func (*WsOptions) Update

func (opts *WsOptions) Update()

Jump to

Keyboard shortcuts

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