protocol

package
v1.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 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           vmess.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 (this *VMessRequest) Destination() v2net.Destination

Destination is the final destination of this request.

func (*VMessRequest) ToBytes

func (this *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 (this *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