options

package
v1.2.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultGrpcOptions = &GrpcOptions{
	TlsOptions: TlsOptions{Mode: None},
}
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 DefaultSshOptions = &SshOptions{}
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 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 SshOptions added in v1.1.1

type SshOptions struct {
	User          string
	Password      string
	PrivateKey    string
	PublicKey     string // only used for client
	AuthorizedKey string // only used for server
}

func (*SshOptions) Update added in v1.1.1

func (opts *SshOptions) 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