Versions in this module Expand all Collapse all v1 v1.8.5 Sep 3, 2023 Changes in this version + const Version + var ErrCommandTooLarge = newError("Command too large.") + var ErrCommandTypeMismatch = newError("Command type mismatch.") + var ErrInsufficientLength = newError("Insufficient length.") + var ErrInvalidAuth = newError("Invalid auth.") + var ErrUnknownCommand = newError("Unknown command.") + func Authenticate(b []byte) uint32 + func GenerateChacha20Poly1305Key(b []byte) []byte + func GenerateChunkNonce(nonce []byte, size uint32) crypto.BytesGenerator + func MarshalCommand(command interface{}, writer io.Writer) error + func UnmarshalCommand(cmdID byte, data []byte) (protocol.ResponseCommand, error) + type AEADSizeParser struct + func NewAEADSizeParser(auth *crypto.AEADAuthenticator) *AEADSizeParser + type ClientSession struct + func NewClientSession(ctx context.Context, behaviorSeed int64) *ClientSession + func (c *ClientSession) DecodeResponseBody(request *protocol.RequestHeader, reader io.Reader) (buf.Reader, error) + func (c *ClientSession) DecodeResponseHeader(reader io.Reader) (*protocol.ResponseHeader, error) + func (c *ClientSession) EncodeRequestBody(request *protocol.RequestHeader, writer io.Writer) (buf.Writer, error) + func (c *ClientSession) EncodeRequestHeader(header *protocol.RequestHeader, writer io.Writer) error + type CommandFactory interface + Marshal func(command interface{}, writer io.Writer) error + Unmarshal func(data []byte) (interface{}, error) + type CommandSwitchAccountFactory struct + func (f *CommandSwitchAccountFactory) Marshal(command interface{}, writer io.Writer) error + func (f *CommandSwitchAccountFactory) Unmarshal(data []byte) (interface{}, error) + type NoOpAuthenticator struct + func (NoOpAuthenticator) NonceSize() int + func (NoOpAuthenticator) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) + func (NoOpAuthenticator) Overhead() int + func (NoOpAuthenticator) Seal(dst, nonce, plaintext, additionalData []byte) []byte + type ServerSession struct + func NewServerSession(validator *vmess.TimedUserValidator, sessionHistory *SessionHistory) *ServerSession + func (s *ServerSession) DecodeRequestBody(request *protocol.RequestHeader, reader io.Reader) (buf.Reader, error) + func (s *ServerSession) DecodeRequestHeader(reader io.Reader, isDrain bool) (*protocol.RequestHeader, error) + func (s *ServerSession) EncodeResponseBody(request *protocol.RequestHeader, writer io.Writer) (buf.Writer, error) + func (s *ServerSession) EncodeResponseHeader(header *protocol.ResponseHeader, writer io.Writer) + type SessionHistory struct + func NewSessionHistory() *SessionHistory + func (h *SessionHistory) Close() error + type ShakeSizeParser struct + func NewShakeSizeParser(nonce []byte) *ShakeSizeParser + func (*ShakeSizeParser) SizeBytes() int32 + func (s *ShakeSizeParser) Decode(b []byte) (uint16, error) + func (s *ShakeSizeParser) Encode(size uint16, b []byte) []byte + func (s *ShakeSizeParser) MaxPaddingLen() uint16 + func (s *ShakeSizeParser) NextPaddingLen() uint16