vmess

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2018 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OptionChunkStream  byte = 1
	OptionChunkMasking byte = 4
)

Request Options

View Source
const (
	CommandTCP byte = 1
	CommandUDP byte = 2
)

Command types

View Source
const (
	AtypIPv4       byte = 1
	AtypDomainName byte = 2
	AtypIPv6       byte = 3
)

Addr types

View Source
const (
	IDBytesLen = 16
)

ID cmdKey length

View Source
const Version byte = 1

Version of vmess

Variables

View Source
var CipherMapping = map[string]byte{
	"none":              SecurityNone,
	"aes-128-gcm":       SecurityAES128GCM,
	"chacha20-poly1305": SecurityCHACHA20POLY1305,
}

CipherMapping return

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is vmess connection generator

func NewClient

func NewClient(config Config) (*Client, error)

NewClient return Client instance

func (*Client) New

func (c *Client) New(conn net.Conn, dst *DstAddr) net.Conn

New return a Conn with net.Conn and DstAddr

type Config

type Config struct {
	UUID     string
	AlterID  uint16
	Security string
	TLS      bool
}

Config of vmess

type Conn

type Conn struct {
	net.Conn
	// contains filtered or unexported fields
}

Conn wrapper a net.Conn with vmess protocol

func (*Conn) Read

func (vc *Conn) Read(b []byte) (int, error)

func (*Conn) Write

func (vc *Conn) Write(b []byte) (int, error)

type DstAddr

type DstAddr struct {
	AddrType byte
	Addr     []byte
	Port     uint
}

DstAddr store destination address

type ID

type ID struct {
	UUID   *uuid.UUID
	CmdKey []byte
}

The ID of en entity, in the form of a UUID.

type Security

type Security = byte

Security type vmess

const (
	SecurityAES128GCM        Security = 3
	SecurityCHACHA20POLY1305 Security = 4
	SecurityNone             Security = 5
)

Cipher types

Jump to

Keyboard shortcuts

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