2017-04-08 19:43:25 -04:00
|
|
|
package encoding
|
|
|
|
|
2018-02-23 17:42:01 -05:00
|
|
|
import (
|
2022-01-02 10:16:23 -05:00
|
|
|
"github.com/v2fly/v2ray-core/v5/common/net"
|
|
|
|
"github.com/v2fly/v2ray-core/v5/common/protocol"
|
2018-02-23 17:42:01 -05:00
|
|
|
)
|
|
|
|
|
2022-01-02 10:16:23 -05:00
|
|
|
//go:generate go run github.com/v2fly/v2ray-core/v5/common/errors/errorgen
|
2018-02-23 17:42:01 -05:00
|
|
|
|
|
|
|
const (
|
|
|
|
Version = byte(1)
|
|
|
|
)
|
|
|
|
|
|
|
|
var addrParser = protocol.NewAddressParser(
|
2018-02-23 18:57:54 -05: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 17:42:01 -05:00
|
|
|
protocol.PortThenAddress(),
|
|
|
|
)
|