github.com/EagleQL/Xray-core@v1.4.3/proxy/vmess/encoding/encoding.go (about)

     1  package encoding
     2  
     3  import (
     4  	"github.com/xtls/xray-core/common/net"
     5  	"github.com/xtls/xray-core/common/protocol"
     6  )
     7  
     8  //go:generate go run github.com/xtls/xray-core/common/errors/errorgen
     9  
    10  const (
    11  	Version = byte(1)
    12  )
    13  
    14  var addrParser = protocol.NewAddressParser(
    15  	protocol.AddressFamilyByte(byte(protocol.AddressTypeIPv4), net.AddressFamilyIPv4),
    16  	protocol.AddressFamilyByte(byte(protocol.AddressTypeDomain), net.AddressFamilyDomain),
    17  	protocol.AddressFamilyByte(byte(protocol.AddressTypeIPv6), net.AddressFamilyIPv6),
    18  	protocol.PortThenAddress(),
    19  )