Documentation ¶
Index ¶
- Constants
- Variables
- func Authenticate(b []byte) uint32
- func GenerateChacha20Poly1305Key(b []byte) []byte
- func MarshalCommand(command interface{}, writer io.Writer) error
- func UnmarshalCommand(cmdID byte, data []byte) (protocol.ResponseCommand, error)
- type ChunkNonceGenerator
- type ClientSession
- func (v *ClientSession) DecodeResponseBody(request *protocol.RequestHeader, reader io.Reader) buf.Reader
- func (v *ClientSession) DecodeResponseHeader(reader io.Reader) (*protocol.ResponseHeader, error)
- func (v *ClientSession) EncodeRequestBody(request *protocol.RequestHeader, writer io.Writer) buf.Writer
- func (v *ClientSession) EncodeRequestHeader(header *protocol.RequestHeader, writer io.Writer)
- type CommandFactory
- type CommandSwitchAccountFactory
- type FnvAuthenticator
- type NoOpAuthenticator
- type ServerSession
- func (v *ServerSession) DecodeRequestBody(request *protocol.RequestHeader, reader io.Reader) buf.Reader
- func (v *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.RequestHeader, error)
- func (v *ServerSession) EncodeResponseBody(request *protocol.RequestHeader, writer io.Writer) buf.Writer
- func (v *ServerSession) EncodeResponseHeader(header *protocol.ResponseHeader, writer io.Writer)
- type SessionHistory
Constants ¶
Variables ¶
View Source
var ( ErrCommandTypeMismatch = newError("Command type mismatch.") ErrUnknownCommand = newError("Unknown command.") ErrCommandTooLarge = newError("Command too large.") )
Functions ¶
func Authenticate ¶
Authenticate authenticates a byte array using Fnv hash.
func GenerateChacha20Poly1305Key ¶
GenerateChacha20Poly1305Key generates a 32-byte key from a given 16-byte array.
Types ¶
type ChunkNonceGenerator ¶
func (*ChunkNonceGenerator) Next ¶
func (v *ChunkNonceGenerator) Next() []byte
type ClientSession ¶
type ClientSession struct {
// contains filtered or unexported fields
}
ClientSession stores connection session info for VMess client.
func NewClientSession ¶
func NewClientSession(idHash protocol.IDHash) *ClientSession
NewClientSession creates a new ClientSession.
func (*ClientSession) DecodeResponseBody ¶
func (v *ClientSession) DecodeResponseBody(request *protocol.RequestHeader, reader io.Reader) buf.Reader
func (*ClientSession) DecodeResponseHeader ¶
func (v *ClientSession) DecodeResponseHeader(reader io.Reader) (*protocol.ResponseHeader, error)
func (*ClientSession) EncodeRequestBody ¶
func (v *ClientSession) EncodeRequestBody(request *protocol.RequestHeader, writer io.Writer) buf.Writer
func (*ClientSession) EncodeRequestHeader ¶
func (v *ClientSession) EncodeRequestHeader(header *protocol.RequestHeader, writer io.Writer)
type CommandFactory ¶
type CommandSwitchAccountFactory ¶
type CommandSwitchAccountFactory struct { }
func (*CommandSwitchAccountFactory) Marshal ¶
func (v *CommandSwitchAccountFactory) Marshal(command interface{}, writer io.Writer) error
func (*CommandSwitchAccountFactory) Unmarshal ¶
func (v *CommandSwitchAccountFactory) Unmarshal(data []byte) (interface{}, error)
type FnvAuthenticator ¶
type FnvAuthenticator struct { }
FnvAuthenticator is an AEAD based on Fnv hash.
func (*FnvAuthenticator) NonceSize ¶
func (v *FnvAuthenticator) NonceSize() int
NonceSize implements AEAD.NonceSize().
func (*FnvAuthenticator) Open ¶
func (v *FnvAuthenticator) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error)
Open implements AEAD.Open().
func (*FnvAuthenticator) Overhead ¶
func (v *FnvAuthenticator) Overhead() int
Overhead impelements AEAD.Overhead().
func (*FnvAuthenticator) Seal ¶
func (v *FnvAuthenticator) Seal(dst, nonce, plaintext, additionalData []byte) []byte
Seal implements AEAD.Seal().
type NoOpAuthenticator ¶
type NoOpAuthenticator struct{}
func (NoOpAuthenticator) NonceSize ¶
func (NoOpAuthenticator) NonceSize() int
func (NoOpAuthenticator) Open ¶
func (NoOpAuthenticator) Open(dst, nonce, ciphertext, additionalData []byte) ([]byte, error)
Open implements AEAD.Open().
func (NoOpAuthenticator) Overhead ¶
func (NoOpAuthenticator) Overhead() int
func (NoOpAuthenticator) Seal ¶
func (NoOpAuthenticator) Seal(dst, nonce, plaintext, additionalData []byte) []byte
Seal implements AEAD.Seal().
type ServerSession ¶
type ServerSession struct {
// contains filtered or unexported fields
}
func NewServerSession ¶
func NewServerSession(validator protocol.UserValidator, sessionHistory *SessionHistory) *ServerSession
NewServerSession creates a new ServerSession, using the given UserValidator. The ServerSession instance doesn't take ownership of the validator.
func (*ServerSession) DecodeRequestBody ¶
func (v *ServerSession) DecodeRequestBody(request *protocol.RequestHeader, reader io.Reader) buf.Reader
func (*ServerSession) DecodeRequestHeader ¶
func (v *ServerSession) DecodeRequestHeader(reader io.Reader) (*protocol.RequestHeader, error)
func (*ServerSession) EncodeResponseBody ¶
func (v *ServerSession) EncodeResponseBody(request *protocol.RequestHeader, writer io.Writer) buf.Writer
func (*ServerSession) EncodeResponseHeader ¶
func (v *ServerSession) EncodeResponseHeader(header *protocol.ResponseHeader, writer io.Writer)
Click to show internal directories.
Click to hide internal directories.