2017-04-09 01:43:25 +02:00
|
|
|
package encoding
|
|
|
|
|
2018-02-23 23:42:01 +01:00
|
|
|
import (
|
|
|
|
"v2ray.com/core/common/net"
|
|
|
|
"v2ray.com/core/common/protocol"
|
|
|
|
)
|
|
|
|
|
2020-10-04 12:41:45 +08:00
|
|
|
//go:generate go run v2ray.com/core/common/errors/errorgen
|
2018-02-23 23:42:01 +01:00
|
|
|
|
|
|
|
const (
|
|
|
|
Version = byte(1)
|
|
|
|
)
|
|
|
|
|
|
|
|
var addrParser = protocol.NewAddressParser(
|
2018-02-24 00:57:54 +01:00
|
|
|
protocol.AddressFamilyByte(byte(protocol.AddressTypeIPv4), net.AddressFamilyIPv4),
|
|
|
|
protocol.AddressFamilyByte(byte(protocol.AddressTypeDomain), net.AddressFamilyDomain),
|
|
|
|
protocol.AddressFamilyByte(byte(protocol.AddressTypeIPv6), net.AddressFamilyIPv6),
|
2018-02-23 23:42:01 +01:00
|
|
|
protocol.PortThenAddress(),
|
|
|
|
)
|