Documentation
¶
Index ¶
- Variables
- func NewHub(opts ...Option) *hub
- type Logger
- type Option
- func WithAuth(username, password string) Option
- func WithDNSServers(servers ...string) Option
- func WithIdleTimeout(timeout time.Duration) Option
- func WithLogger(l Logger) Option
- func WithMaxConnections(max int) Option
- func WithPort(port int) Option
- func WithTLS() Option
- func WithTLSConfig(certFile, keyFile string) Option
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultConfig = config{ MixedPort: 1080, MaxConnections: 1000, IdleTimeout: 5 * time.Minute, DNS: dnsConfig{ Servers: []string{ "8.8.8.8:53", "119.29.29.29:53", }, CacheTTL: 10 * time.Minute, }, Credentials: make(map[string]string), }
DefaultConfig 默认配置
Functions ¶
Types ¶
type Logger ¶
type Logger interface {
Debugf(format string, args ...any)
Infof(format string, args ...any)
Warnf(format string, args ...any)
Errorf(format string, args ...any)
}
Logger 日志接口
Click to show internal directories.
Click to hide internal directories.