Versions in this module Expand all Collapse all v0 v0.0.2 Jun 19, 2021 Changes in this version + const Version + var ErrCommandTooLarge = newError("Command too large.") + var ErrCommandTypeMismatch = newError("Command type mismatch.") + 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 ClientSession struct + func NewClientSession(idHash protocol.IDHash) *ClientSession + func (c *ClientSession) DecodeResponseBody(request *protocol.RequestHeader, reader io.Reader) buf.Reader + func (c *ClientSession) DecodeResponseHeader(reader io.Reader) (*protocol.ResponseHeader, error) + func (c *ClientSession) EncodeRequestBody(request *protocol.RequestHeader, writer io.Writer) buf.Writer + 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 FnvAuthenticator struct + func (*FnvAuthenticator) NonceSize() int + func (*FnvAuthenticator) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error) + func (*FnvAuthenticator) Overhead() int + func (*FnvAuthenticator) Seal(dst, nonce, plaintext, additionalData []byte) []byte + 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 + func (s *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.RequestHeader, error) + func (s *ServerSession) EncodeResponseBody(request *protocol.RequestHeader, writer io.Writer) buf.Writer + 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