Documentation ¶
Index ¶
- Constants
- func GetBuffer(size int) []byte
- func GetKey(uuid [16]byte) []byte
- func GetWriteBuffer() *bytes.Buffer
- func InitBufPools() []sync.Pool
- func InitWriteBufPool() sync.Pool
- func PutBuffer(buf []byte) error
- func PutWriteBuffer(buf *bytes.Buffer)
- func StrToUUID(s string) (uuid [16]byte, err error)
- func TimestampHash(unixSec int64) []byte
- type APIConfig
- type Client
- type Config
- type InboundConn
- type MySQLConfig
- type OutboundConn
- type PacketConn
- func (c *PacketConn) ReadFrom(payload []byte) (int, net.Addr, error)
- func (c *PacketConn) ReadWithMetadata(payload []byte) (int, *tunnel.Metadata, error)
- func (c *PacketConn) WriteTo(payload []byte, addr net.Addr) (int, error)
- func (c *PacketConn) WriteWithMetadata(payload []byte, metadata *tunnel.Metadata) (int, error)
- type PaddingLengthGenerator
- type Server
- type SessionId
- type ShakeSizeParser
- type Tunnel
- type User
- type UserAtTime
- type Users
Constants ¶
View Source
const ( TCP tunnel.Command = 1 UDP tunnel.Command = 2 )
View Source
const ( OptBasicFormat byte = 0 // 不加密传输 OptChunkStream byte = 1 // 分块传输,每个分块使用如下Security方法加密 // OptReuseTCPConnection byte = 2 // OptMetadataObfuscate byte = 4 OptChunkMasking byte = 4 OptGlobalPadding byte = 8 )
Request Options
View Source
const ( SecurityAES128GCM byte = 3 SecurityChacha20Poly1305 byte = 4 SecurityNone byte = 5 SecurityZero byte = 6 )
Security types
View Source
const ( CmdTCP byte = 1 CmdUDP byte = 2 )
CMD types
View Source
const ( AtypIP4 byte = 1 AtypDomain byte = 2 AtypIP6 byte = 3 )
Atyp
View Source
const (
MaxPacketSize = 1024 * 8
)
View Source
const Name = "VMESS"
Variables ¶
This section is empty.
Functions ¶
func GetKey ¶
GetKey returns the key of AES-128-CFB encrypter Key:MD5(UUID + []byte('c48619fe-8f02-49e0-b9e9-edf763e17e21'))
func GetWriteBuffer ¶
func InitBufPools ¶
func InitWriteBufPool ¶
func PutWriteBuffer ¶
func TimestampHash ¶
TimestampHash returns the iv of AES-128-CFB encrypter IV:MD5(X + X + X + X),X = []byte(timestamp.now) (8 bytes, Big Endian)
Types ¶
type APIConfig ¶ added in v1.0.7
type APIConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) DialPacket ¶
type Config ¶
type Config struct { LocalHost string `json:"local_addr" yaml:"local-addr"` LocalPort int `json:"local_port" yaml:"local-port"` RemoteHost string `json:"remote_addr" yaml:"remote-addr"` RemotePort int `json:"remote_port" yaml:"remote-port"` UUID string `json:"uuid" yaml:"uuid"` AlterID int `json:"alterId" yaml:"alterId"` Security string `json:"security" yaml:"security"` Port string `json:"port" yaml:"port"` HostName string `json:"hostName" yaml:"hostName"` IsAead bool `json:"isAead" yaml:"isAead"` MySQL MySQLConfig `json:"mysql" yaml:"mysql"` API APIConfig `json:"api" yaml:"api"` }
type InboundConn ¶
InboundConn is a vmess inbound connection
func (*InboundConn) Close ¶ added in v1.0.7
func (c *InboundConn) Close() error
func (*InboundConn) Metadata ¶
func (c *InboundConn) Metadata() *tunnel.Metadata
type MySQLConfig ¶ added in v1.0.7
type MySQLConfig struct {
Enabled bool `json:"enabled" yaml:"enabled"`
}
type OutboundConn ¶
func (*OutboundConn) Auth ¶
func (vc *OutboundConn) Auth() error
func (*OutboundConn) DecodeRespHeader ¶
func (vc *OutboundConn) DecodeRespHeader() error
func (*OutboundConn) Metadata ¶
func (c *OutboundConn) Metadata() *tunnel.Metadata
func (*OutboundConn) Request ¶
func (vc *OutboundConn) Request() error
type PacketConn ¶ added in v1.0.7
func (*PacketConn) ReadWithMetadata ¶ added in v1.0.7
func (*PacketConn) WriteWithMetadata ¶ added in v1.0.7
type PaddingLengthGenerator ¶ added in v1.0.7
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AcceptPacket ¶
type ShakeSizeParser ¶ added in v1.0.7
type ShakeSizeParser struct {
// contains filtered or unexported fields
}
func NewShakeSizeParser ¶ added in v1.0.7
func NewShakeSizeParser(nonce []byte, shouldPad bool) *ShakeSizeParser
func (*ShakeSizeParser) Decode ¶ added in v1.0.7
func (s *ShakeSizeParser) Decode(b []byte) (uint16, error)
func (*ShakeSizeParser) Encode ¶ added in v1.0.7
func (s *ShakeSizeParser) Encode(size uint16, b []byte) []byte
func (*ShakeSizeParser) NextPaddingLen ¶ added in v1.0.7
func (s *ShakeSizeParser) NextPaddingLen() uint16
func (*ShakeSizeParser) SizeBytes ¶ added in v1.0.7
func (*ShakeSizeParser) SizeBytes() int32
type User ¶
Vmess user
func (*User) GenAlterIDUsers ¶
GenAlterIDUsers generates users according to primary user's id and alterID
type UserAtTime ¶
type UserAtTime struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.