2017-04-08 23:43:25 +00:00
|
|
|
package encoding
|
|
|
|
|
2018-02-23 22:42:01 +00:00
|
|
|
import (
|
|
|
|
"v2ray.com/core/common/net"
|
|
|
|
"v2ray.com/core/common/protocol"
|
|
|
|
)
|
|
|
|
|
2018-09-30 21:08:41 +00:00
|
|
|
//go:generate errorgen
|
2018-02-23 22:42:01 +00:00
|
|
|
|
|
|
|
const (
|
|
|
|
Version = byte(1)
|
|
|
|
)
|
|
|
|
|
|
|
|
var addrParser = protocol.NewAddressParser(
|
2018-02-23 23:57:54 +00: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 22:42:01 +00:00
|
|
|
protocol.PortThenAddress(),
|
|
|
|
)
|