Documentation
¶
Overview ¶
Package vmess implements vmess client.
from github.com/Dreamacro/clash/tree/master/transport/vmess/
本作不支持alterid!=0 的情况. 即 仅支持 使用 aead 方式 进行认证
标准: https://www.v2fly.org/developer/protocols/vmess.html
aead:
Index ¶
- Constants
- func AEADReader(r io.Reader, aead cipher.AEAD, iv []byte) io.Reader
- func AEADWriter(w io.Writer, aead cipher.AEAD, iv []byte) io.Writer
- func ChunkedReader(r io.Reader) io.Reader
- func ChunkedWriter(w io.Writer) io.Writer
- func GetKey(uuid [16]byte) []byte
- func TimestampHash(unixSec int64) []byte
- type Client
- type ClientConn
- func (c *ClientConn) CloseConnWithRaddr(_ netLayer.Addr) error
- func (c *ClientConn) Fullcone() bool
- func (c *ClientConn) Read(b []byte) (n int, err error)
- func (c *ClientConn) ReadMsgFrom() (bs []byte, target netLayer.Addr, err error)
- func (c *ClientConn) Write(b []byte) (n int, err error)
- func (c *ClientConn) WriteMsgTo(b []byte, _ netLayer.Addr) error
- type ClientCreator
Constants ¶
const ( OptBasicFormat byte = 0 // 不加密传输 OptChunkStream byte = 1 // 分块传输,每个分块使用如下Security方法加密 )
Request Options
const ( SecurityAES128GCM byte = 3 SecurityChacha20Poly1305 byte = 4 SecurityNone byte = 5 )
Security types
const ( CmdTCP byte = 1 CmdUDP byte = 2 )
v2ray CMD types
const Name = "vmess"
Variables ¶
This section is empty.
Functions ¶
func AEADReader ¶
AEADReader returns a aead reader
func AEADWriter ¶
AEADWriter returns a aead writer
func ChunkedReader ¶
ChunkedReader returns a chunked reader
func ChunkedWriter ¶
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 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 ClientConn ¶
ClientConn is a connection to vmess server
func (*ClientConn) CloseConnWithRaddr ¶
func (c *ClientConn) CloseConnWithRaddr(_ netLayer.Addr) error
func (*ClientConn) Fullcone ¶
func (c *ClientConn) Fullcone() bool
vmess 标准 是不支持 fullcone的,和vless v0相同
func (*ClientConn) ReadMsgFrom ¶
func (c *ClientConn) ReadMsgFrom() (bs []byte, target netLayer.Addr, err error)
func (*ClientConn) WriteMsgTo ¶
func (c *ClientConn) WriteMsgTo(b []byte, _ netLayer.Addr) error
type ClientCreator ¶
type ClientCreator struct{}