protocol

package
v0.14.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 26, 2015 License: MIT Imports: 12 Imported by: 0

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
	User           config.User
	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 *alloc.Buffer) (*alloc.Buffer, 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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL