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 StringOrNumber
- type User
- type VMess
- type VMessJson
Constants ¶
const ( OptBasicFormat byte = 0 OptChunkStream byte = 1 // OptReuseTCPConnection byte = 2 OptChunkMasking byte = 4 )
Request Options
const ( SecurityAES128GCM byte = 3 SecurityChacha20Poly1305 byte = 4 SecurityNone byte = 5 )
Security types
const MaxHostLen = 255
MaxHostLen is the maximum size of host in bytes.
Variables ¶
This section is empty.
Functions ¶
func AEADReader ¶
func AEADReader(r io.Reader, aead cipher.AEAD, iv []byte, chunkSizeDecoder ChunkSizeDecoder) io.Reader
AEADReader returns a aead reader.
func AEADWriter ¶
func AEADWriter(w io.Writer, aead cipher.AEAD, iv []byte, chunkSizeEncoder ChunkSizeEncoder) io.Writer
AEADWriter returns a aead writer.
func ChunkedReader ¶
func ChunkedReader(r io.Reader, chunkSizeDecoder ChunkSizeDecoder) io.Reader
ChunkedReader returns a chunked reader.
func ChunkedWriter ¶
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 ¶
ChunkSizeDecoder is a utility class to decode size value from bytes.
type ChunkSizeEncoder ¶
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 ¶
PktConn is a udp Packet.Conn.
func NewPktConn ¶
NewPktConn returns a PktConn.
type ShakeSizeParser ¶
type ShakeSizeParser struct {
// contains filtered or unexported fields
}
ShakeSizeParser implements ChunkSizeEncoder & ChunkSizeDecoder.
func NewShakeSizeParser ¶
func NewShakeSizeParser(nonce []byte) *ShakeSizeParser
NewShakeSizeParser returns a new ShakeSizeParser.
func (*ShakeSizeParser) Decode ¶
func (s *ShakeSizeParser) Decode(b []byte) (uint16, error)
Decode implements ChunkSizeDecoder method.
func (*ShakeSizeParser) Encode ¶
func (s *ShakeSizeParser) Encode(size uint16, b []byte) []byte
Encode implements ChunkSizeEncoder method.
func (*ShakeSizeParser) SizeBytes ¶
func (*ShakeSizeParser) SizeBytes() int32
SizeBytes implements ChunkSizeEncoder method.
type StringOrNumber ¶
type StringOrNumber string
func (*StringOrNumber) UnmarshalJSON ¶
func (sn *StringOrNumber) UnmarshalJSON(data []byte) error
UnmarshalJSON 是 StringOrNumber 的自定义解码函数
type User ¶
User of vmess client.
func (*User) GenAlterIDUsers ¶
GenAlterIDUsers generates users according to primary user's id and alterID.
type VMess ¶
type VMess struct {
// contains filtered or unexported fields
}
VMess struct.