mirror of
https://github.com/v2fly/v2ray-core.git
synced 2025-10-16 22:14:02 -04:00
unify all address reading and writing
This commit is contained in:
@@ -1,3 +1,19 @@
|
||||
package encoding
|
||||
|
||||
import (
|
||||
"v2ray.com/core/common/net"
|
||||
"v2ray.com/core/common/protocol"
|
||||
)
|
||||
|
||||
//go:generate go run $GOPATH/src/v2ray.com/core/common/errors/errorgen/main.go -pkg encoding -path Proxy,VMess,Encoding
|
||||
|
||||
const (
|
||||
Version = byte(1)
|
||||
)
|
||||
|
||||
var addrParser = protocol.NewAddressParser(
|
||||
protocol.AddressFamilyByte(0x01, net.AddressFamilyIPv4),
|
||||
protocol.AddressFamilyByte(0x02, net.AddressFamilyDomain),
|
||||
protocol.AddressFamilyByte(0x03, net.AddressFamilyIPv6),
|
||||
protocol.PortThenAddress(),
|
||||
)
|
||||
|
Reference in New Issue
Block a user