v2ray-core/proxy/vmess/encoding/encoding.go

20 lines
478 B
Go

package encoding
import (
"v2ray.com/core/common/net"
"v2ray.com/core/common/protocol"
)
//go:generate errorgen
const (
Version = byte(1)
)
var addrParser = protocol.NewAddressParser(
protocol.AddressFamilyByte(byte(protocol.AddressTypeIPv4), net.AddressFamilyIPv4),
protocol.AddressFamilyByte(byte(protocol.AddressTypeDomain), net.AddressFamilyDomain),
protocol.AddressFamilyByte(byte(protocol.AddressTypeIPv6), net.AddressFamilyIPv6),
protocol.PortThenAddress(),
)