vmess

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Feb 11, 2019 License: MIT Imports: 22 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

func NewWebsocketConn added in v0.11.0

func NewWebsocketConn(conn net.Conn, c *WebsocketConfig) (net.Conn, error)

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, error)

New return a Conn with net.Conn and DstAddr

type Config

type Config struct {
	UUID             string
	AlterID          uint16
	Security         string
	TLS              bool
	HostName         string
	Port             string
	NetWork          string
	WebSocketPath    string
	WebSocketHeaders map[string]string
	SkipCertVerify   bool
	SessionCacahe    tls.ClientSessionCache
}

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

type WebsocketConfig added in v0.11.0

type WebsocketConfig struct {
	Host      string
	Path      string
	Headers   map[string]string
	TLS       bool
	TLSConfig *tls.Config
}

Jump to

Keyboard shortcuts

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