Documentation ¶
Overview ¶
Package vmess contains protocol definition, io lib for VMess.
Index ¶
Constants ¶
View Source
const ( CmdTCP = byte(0x01) CmdUDP = byte(0x02) Version = byte(0x01) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type VMessRequest ¶
type VMessRequest struct { Version byte UserId config.ID RequestIV []byte RequestKey []byte ResponseHeader []byte Command byte Address v2net.Address }
VMessRequest implements the request message of VMess protocol. It only contains the header of a request message. The data part will be handled by conection handler directly, in favor of data streaming.
func (*VMessRequest) Destination ¶
func (request *VMessRequest) Destination() v2net.Destination
Destination is the final destination of this request.
func (*VMessRequest) ToBytes ¶
func (request *VMessRequest) ToBytes(idHash user.CounterHash, randomRangeInt64 user.RandomInt64InRange, buffer []byte) ([]byte, error)
ToBytes returns a VMessRequest in the form of byte array.
type VMessRequestReader ¶
type VMessRequestReader struct {
// contains filtered or unexported fields
}
VMessRequestReader is a parser to read VMessRequest from a byte stream.
func NewVMessRequestReader ¶
func NewVMessRequestReader(vUserSet user.UserSet) *VMessRequestReader
NewVMessRequestReader creates a new VMessRequestReader with a given UserSet
func (*VMessRequestReader) Read ¶
func (r *VMessRequestReader) Read(reader io.Reader) (*VMessRequest, error)
Read reads a VMessRequest from a byte stream.
Click to show internal directories.
Click to hide internal directories.