mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-08-25 22:26:28 +00:00
20 lines
556 B
Go
20 lines
556 B
Go
|
package encoding
|
||
|
|
||
|
import (
|
||
|
"github.com/xtls/xray-core/v1/common/net"
|
||
|
"github.com/xtls/xray-core/v1/common/protocol"
|
||
|
)
|
||
|
|
||
|
//go:generate go run github.com/xtls/xray-core/v1/common/errors/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(),
|
||
|
)
|