Versions in this module Expand all Collapse all v1 v1.5.6 Mar 27, 2022 Changes in this version + var AuthType_name = map[int32]string + var AuthType_value = map[string]int32 + var File_proxy_socks_config_proto protoreflect.FileDescriptor + var Version_name = map[int32]string + var Version_value = map[string]int32 + func ClientHandshake(request *protocol.RequestHeader, reader io.Reader, writer io.Writer) (*protocol.RequestHeader, error) + func DecodeUDPPacket(packet *buf.Buffer) (*protocol.RequestHeader, error) + func EncodeUDPPacket(request *protocol.RequestHeader, data []byte) (*buf.Buffer, error) + func ReadUntilNull(reader io.Reader) (string, error) + func ReadUsernamePassword(reader io.Reader) (string, string, error) + type Account struct + Password string + Username string + func (*Account) Descriptor() ([]byte, []int) + func (*Account) ProtoMessage() + func (a *Account) AsAccount() (protocol.Account, error) + func (a *Account) Equals(another protocol.Account) bool + func (x *Account) GetPassword() string + func (x *Account) GetUsername() string + func (x *Account) ProtoReflect() protoreflect.Message + func (x *Account) Reset() + func (x *Account) String() string + type AuthType int32 + const AuthType_NO_AUTH + const AuthType_PASSWORD + func (AuthType) Descriptor() protoreflect.EnumDescriptor + func (AuthType) EnumDescriptor() ([]byte, []int) + func (AuthType) Type() protoreflect.EnumType + func (x AuthType) Enum() *AuthType + func (x AuthType) Number() protoreflect.EnumNumber + func (x AuthType) String() string + type Client struct + func NewClient(ctx context.Context, config *ClientConfig) (*Client, error) + func (c *Client) Process(ctx context.Context, link *transport.Link, dialer internet.Dialer) error + type ClientConfig struct + Server []*protocol.ServerEndpoint + Version Version + func (*ClientConfig) Descriptor() ([]byte, []int) + func (*ClientConfig) ProtoMessage() + func (x *ClientConfig) GetServer() []*protocol.ServerEndpoint + func (x *ClientConfig) GetVersion() Version + func (x *ClientConfig) ProtoReflect() protoreflect.Message + func (x *ClientConfig) Reset() + func (x *ClientConfig) String() string + type Server struct + func NewServer(ctx context.Context, config *ServerConfig) (*Server, error) + func (s *Server) Network() []net.Network + func (s *Server) Process(ctx context.Context, network net.Network, conn stat.Connection, ...) error + type ServerConfig struct + Accounts map[string]string + Address *net.IPOrDomain + AuthType AuthType + Timeout uint32 + UdpEnabled bool + UserLevel uint32 + func (*ServerConfig) Descriptor() ([]byte, []int) + func (*ServerConfig) ProtoMessage() + func (c *ServerConfig) HasAccount(username, password string) bool + func (x *ServerConfig) GetAccounts() map[string]string + func (x *ServerConfig) GetAddress() *net.IPOrDomain + func (x *ServerConfig) GetAuthType() AuthType + func (x *ServerConfig) GetTimeout() uint32 + func (x *ServerConfig) GetUdpEnabled() bool + func (x *ServerConfig) GetUserLevel() uint32 + func (x *ServerConfig) ProtoReflect() protoreflect.Message + func (x *ServerConfig) Reset() + func (x *ServerConfig) String() string + type ServerSession struct + func (s *ServerSession) Handshake(reader io.Reader, writer io.Writer) (*protocol.RequestHeader, error) + type UDPReader struct + Reader io.Reader + func (r *UDPReader) ReadMultiBuffer() (buf.MultiBuffer, error) + type UDPWriter struct + Request *protocol.RequestHeader + Writer io.Writer + func (w *UDPWriter) WriteMultiBuffer(mb buf.MultiBuffer) error + type Version int32 + const Version_SOCKS4 + const Version_SOCKS4A + const Version_SOCKS5 + func (Version) Descriptor() protoreflect.EnumDescriptor + func (Version) EnumDescriptor() ([]byte, []int) + func (Version) Type() protoreflect.EnumType + func (x Version) Enum() *Version + func (x Version) Number() protoreflect.EnumNumber + func (x Version) String() string