Documentation
¶
Index ¶
- Constants
- Variables
- type Client
- func (c *Client) CloseIdleConnections()
- func (c *Client) CloseWithError(err error) error
- func (c *Client) DialConn(ctx context.Context, destination M.Socksaddr) (net.Conn, error)
- func (c *Client) ListenPacket(ctx context.Context) (net.PacketConn, error)
- func (c *Client) SetKeepIdleConnections(keep bool)
- type ClientOptions
- type Service
- type ServiceHandler
- type ServiceOptions
Constants ¶
View Source
const ( CommandAuthenticate = iota CommandConnect CommandPacket CommandDissociate CommandHeartbeat CommandResponse = 0xff )
View Source
const ( OptionResponseSuccess = 0x00 OptionResponseFailed = 0xff ErrorCodeProtocolError = uint64(0xfffffff0) ErrorCodeAuthenticationFailed = uint64(0xfffffff1) ErrorCodeAuthenticationTimeout = uint64(0xfffffff2) ErrorCodeBadCommand = uint64(0xfffffff3) )
View Source
const AuthenticateLen = 2 + 32
View Source
const (
Version = 4
)
Variables ¶
View Source
var AddressSerializer = M.NewSerializer( M.AddressFamilyByte(0x00, M.AddressFamilyFqdn), M.AddressFamilyByte(0x01, M.AddressFamilyIPv4), M.AddressFamilyByte(0x02, M.AddressFamilyIPv6), )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(options ClientOptions) (*Client, error)
func (*Client) CloseIdleConnections ¶
func (c *Client) CloseIdleConnections()
func (*Client) CloseWithError ¶
func (*Client) ListenPacket ¶
func (*Client) SetKeepIdleConnections ¶
type ClientOptions ¶
type ClientOptions struct {
Context context.Context
Dialer N.Dialer
ServerAddress M.Socksaddr
TLSConfig aTLS.Config
QUICConfig *quic.Config
QUICOptions qtls.QUICOptions
Password string
CongestionControl string
UDPStream bool
ZeroRTTHandshake bool
Heartbeat time.Duration
// Deperecated: no-op
UDPMTU int
}
type Service ¶
type Service[U comparable] struct { // contains filtered or unexported fields }
func NewService ¶
func NewService[U comparable](options ServiceOptions) (*Service[U], error)
func (*Service[U]) UpdateUsers ¶
type ServiceHandler ¶
type ServiceHandler interface {
N.TCPConnectionHandlerEx
N.UDPConnectionHandlerEx
}
type ServiceOptions ¶
type ServiceOptions struct {
Context context.Context
Logger logger.Logger
TLSConfig aTLS.ServerConfig
QUICConfig *quic.Config
QUICOptions qtls.QUICOptions
CongestionControl string
AuthTimeout time.Duration
ZeroRTTHandshake bool
Heartbeat time.Duration
UDPTimeout time.Duration
Handler ServiceHandler
// Deperecated: no-op
UDPMTU int
}
Click to show internal directories.
Click to hide internal directories.