vmess

package
v0.0.0-...-73a744e Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2019 License: GPL-3.0 Imports: 23 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

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
	SessionCache     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 {
	UDP      bool
	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

type WebsocketConfig struct {
	Host      string
	Path      string
	Headers   http.Header
	TLS       bool
	TLSConfig *tls.Config
}

Jump to

Keyboard shortcuts

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