Documentation ¶
Index ¶
- Constants
- func AEADReader(r io.Reader, aead cipher.AEAD, iv []byte, chunkSizeDecoder ChunkSizeDecoder) io.Reader
- func AEADWriter(w io.Writer, aead cipher.AEAD, iv []byte, chunkSizeEncoder ChunkSizeEncoder) io.Writer
- func ChunkedReader(r io.Reader, chunkSizeDecoder ChunkSizeDecoder) io.Reader
- func ChunkedWriter(w io.Writer, chunkSizeEncoder ChunkSizeEncoder) io.Writer
- func GetKey(uuid [16]byte) []byte
- func NewVMessDialer(s string, dialer proxy.Dialer) (proxy.Dialer, error)
- func ParseAddr(s string) (Atyp, Addr, Port, error)
- func StrToUUID(s string) (uuid [16]byte, err error)
- func TimestampHash(t time.Time) []byte
- type Addr
- type Atyp
- type ChunkSizeDecoder
- type ChunkSizeEncoder
- type Client
- type CmdType
- type Conn
- type PktConn
- type Port
- type ShakeSizeParser
- type User
- type VMess
Constants ¶
const ( OptBasicFormat byte = 0 OptChunkStream byte = 1 // OptReuseTCPConnection byte = 2 OptMetadataObfuscate byte = 4 )
Request Options
const ( SecurityAES128GCM byte = 3 SecurityChacha20Poly1305 byte = 4 SecurityNone byte = 5 )
Security types
Variables ¶
This section is empty.
Functions ¶
func AEADReader ¶ added in v0.6.2
func AEADReader(r io.Reader, aead cipher.AEAD, iv []byte, chunkSizeDecoder ChunkSizeDecoder) io.Reader
AEADReader returns a aead reader.
func AEADWriter ¶ added in v0.6.2
func AEADWriter(w io.Writer, aead cipher.AEAD, iv []byte, chunkSizeEncoder ChunkSizeEncoder) io.Writer
AEADWriter returns a aead writer.
func ChunkedReader ¶ added in v0.6.2
func ChunkedReader(r io.Reader, chunkSizeDecoder ChunkSizeDecoder) io.Reader
ChunkedReader returns a chunked reader.
func ChunkedWriter ¶ added in v0.6.2
func ChunkedWriter(w io.Writer, chunkSizeEncoder ChunkSizeEncoder) io.Writer
ChunkedWriter returns a chunked writer.
func GetKey ¶
GetKey returns the key of AES-128-CFB encrypter. Key:MD5(UUID + []byte('c48619fe-8f02-49e0-b9e9-edf763e17e21'))
func NewVMessDialer ¶
NewVMessDialer returns a vmess proxy dialer.
func TimestampHash ¶
TimestampHash returns the iv of AES-128-CFB encrypter. IV:MD5(X + X + X + X),X = []byte(timestamp.now) (8 bytes, Big Endian)
Types ¶
type ChunkSizeDecoder ¶ added in v0.15.1
ChunkSizeDecoder is a utility class to decode size value from bytes.
type ChunkSizeEncoder ¶ added in v0.15.1
ChunkSizeEncoder is a utility class to encode size value into bytes.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a vmess client.
type Conn ¶
Conn is a connection to vmess server.
func (*Conn) DecodeRespHeader ¶
DecodeRespHeader decodes response header.
type PktConn ¶ added in v0.13.0
PktConn is a udp Packet.Conn.
func NewPktConn ¶ added in v0.13.0
NewPktConn returns a PktConn.
type ShakeSizeParser ¶ added in v0.15.1
type ShakeSizeParser struct {
// contains filtered or unexported fields
}
func NewShakeSizeParser ¶ added in v0.15.1
func NewShakeSizeParser(nonce []byte) *ShakeSizeParser
func (*ShakeSizeParser) Decode ¶ added in v0.15.1
func (s *ShakeSizeParser) Decode(b []byte) (uint16, error)
func (*ShakeSizeParser) Encode ¶ added in v0.15.1
func (s *ShakeSizeParser) Encode(size uint16, b []byte) []byte
func (*ShakeSizeParser) MaxPaddingLen ¶ added in v0.15.1
func (s *ShakeSizeParser) MaxPaddingLen() uint16
func (*ShakeSizeParser) NextPaddingLen ¶ added in v0.15.1
func (s *ShakeSizeParser) NextPaddingLen() uint16
func (*ShakeSizeParser) SizeBytes ¶ added in v0.15.1
func (*ShakeSizeParser) SizeBytes() int32
type User ¶
User of vmess client.
func (*User) GenAlterIDUsers ¶
GenAlterIDUsers generates users according to primary user's id and alterID.