Versions in this module Expand all Collapse all v1 v1.5.7 Jun 2, 2022 Changes in this version + const Version + var CipherType_name = map[int32]string + var CipherType_value = map[string]int32 + var ErrIVNotUnique = newError("IV is not unique") + var ErrNotFound = newError("Not Found") + var File_proxy_shadowsocks_config_proto protoreflect.FileDescriptor + func DecodeUDPPacket(validator *Validator, payload *buf.Buffer) (*protocol.RequestHeader, *buf.Buffer, error) + func EncodeUDPPacket(request *protocol.RequestHeader, payload []byte) (*buf.Buffer, error) + func ReadTCPResponse(user *protocol.MemoryUser, reader io.Reader) (buf.Reader, error) + func ReadTCPSession(validator *Validator, reader io.Reader) (*protocol.RequestHeader, buf.Reader, error) + func WriteTCPRequest(request *protocol.RequestHeader, writer io.Writer) (buf.Writer, error) + func WriteTCPResponse(request *protocol.RequestHeader, writer io.Writer) (buf.Writer, error) + type AEADCipher struct + AEADAuthCreator func(key []byte) cipher.AEAD + IVBytes int32 + KeyBytes int32 + func (*AEADCipher) IsAEAD() bool + func (c *AEADCipher) DecodePacket(key []byte, b *buf.Buffer) error + func (c *AEADCipher) EncodePacket(key []byte, b *buf.Buffer) error + func (c *AEADCipher) IVSize() int32 + func (c *AEADCipher) KeySize() int32 + func (c *AEADCipher) NewDecryptionReader(key []byte, iv []byte, reader io.Reader) (buf.Reader, error) + func (c *AEADCipher) NewEncryptionWriter(key []byte, iv []byte, writer io.Writer) (buf.Writer, error) + type Account struct + CipherType CipherType + IvCheck bool + Password string + func (*Account) Descriptor() ([]byte, []int) + func (*Account) ProtoMessage() + func (a *Account) AsAccount() (protocol.Account, error) + func (x *Account) GetCipherType() CipherType + func (x *Account) GetIvCheck() bool + func (x *Account) GetPassword() string + func (x *Account) ProtoReflect() protoreflect.Message + func (x *Account) Reset() + func (x *Account) String() string + type Cipher interface + DecodePacket func(key []byte, b *buf.Buffer) error + EncodePacket func(key []byte, b *buf.Buffer) error + IVSize func() int32 + IsAEAD func() bool + KeySize func() int32 + NewDecryptionReader func(key []byte, iv []byte, reader io.Reader) (buf.Reader, error) + NewEncryptionWriter func(key []byte, iv []byte, writer io.Writer) (buf.Writer, error) + type CipherType int32 + const CipherType_AES_128_GCM + const CipherType_AES_256_GCM + const CipherType_CHACHA20_POLY1305 + const CipherType_NONE + const CipherType_UNKNOWN + const CipherType_XCHACHA20_POLY1305 + func (CipherType) Descriptor() protoreflect.EnumDescriptor + func (CipherType) EnumDescriptor() ([]byte, []int) + func (CipherType) Type() protoreflect.EnumType + func (x CipherType) Enum() *CipherType + func (x CipherType) Number() protoreflect.EnumNumber + func (x CipherType) 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 + func (*ClientConfig) Descriptor() ([]byte, []int) + func (*ClientConfig) ProtoMessage() + func (x *ClientConfig) GetServer() []*protocol.ServerEndpoint + func (x *ClientConfig) ProtoReflect() protoreflect.Message + func (x *ClientConfig) Reset() + func (x *ClientConfig) String() string + type FullReader struct + func (r *FullReader) Read(p []byte) (n int, err error) + type MemoryAccount struct + Cipher Cipher + Key []byte + func (a *MemoryAccount) CheckIV(iv []byte) error + func (a *MemoryAccount) Equals(another protocol.Account) bool + type NoneCipher struct + func (NoneCipher) DecodePacket(key []byte, b *buf.Buffer) error + func (NoneCipher) EncodePacket(key []byte, b *buf.Buffer) error + func (NoneCipher) IVSize() int32 + func (NoneCipher) IsAEAD() bool + func (NoneCipher) KeySize() int32 + func (NoneCipher) NewDecryptionReader(key []byte, iv []byte, reader io.Reader) (buf.Reader, error) + func (NoneCipher) NewEncryptionWriter(key []byte, iv []byte, writer io.Writer) (buf.Writer, error) + type Server struct + func NewServer(ctx context.Context, config *ServerConfig) (*Server, error) + func (s *Server) AddUser(ctx context.Context, u *protocol.MemoryUser) error + func (s *Server) Network() []net.Network + func (s *Server) Process(ctx context.Context, network net.Network, conn stat.Connection, ...) error + func (s *Server) RemoveUser(ctx context.Context, e string) error + type ServerConfig struct + Network []net.Network + Users []*protocol.User + func (*ServerConfig) Descriptor() ([]byte, []int) + func (*ServerConfig) ProtoMessage() + func (x *ServerConfig) GetNetwork() []net.Network + func (x *ServerConfig) GetUsers() []*protocol.User + func (x *ServerConfig) ProtoReflect() protoreflect.Message + func (x *ServerConfig) Reset() + func (x *ServerConfig) String() string + type UDPReader struct + Reader io.Reader + User *protocol.MemoryUser + func (v *UDPReader) ReadMultiBuffer() (buf.MultiBuffer, error) + type UDPWriter struct + Request *protocol.RequestHeader + Writer io.Writer + func (w *UDPWriter) WriteMultiBuffer(mb buf.MultiBuffer) error + type Validator struct + func (v *Validator) Add(u *protocol.MemoryUser) error + func (v *Validator) Del(email string) error + func (v *Validator) Get(bs []byte, command protocol.RequestCommand) (u *protocol.MemoryUser, aead cipher.AEAD, ret []byte, ivLen int32, err error) + func (v *Validator) GetBehaviorSeed() uint64