mirror of
https://github.com/e1732a364fed/v2ray_simple.git
synced 2025-10-13 20:43:41 +08:00
在route中使用netip.Addr;修订代码;添加一些go test
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
package netLayer
|
||||
|
||||
const (
|
||||
// transport Layer, 使用uint16 mask,所以最多支持16种
|
||||
// Transport Layer Protocols, 使用uint16 mask,所以最多支持16种
|
||||
|
||||
TCP uint16 = 1 << iota
|
||||
UDP
|
||||
@@ -16,9 +16,9 @@ const (
|
||||
|
||||
func StrToTransportProtocol(s string) uint16 {
|
||||
switch s {
|
||||
case "tcp":
|
||||
case "tcp", "tcp4", "tcp6":
|
||||
return TCP
|
||||
case "udp":
|
||||
case "udp", "udp4", "udp6":
|
||||
return UDP
|
||||
case "unix":
|
||||
return UNIX
|
||||
@@ -28,7 +28,6 @@ func StrToTransportProtocol(s string) uint16 {
|
||||
return KCP
|
||||
case "quic":
|
||||
return Quic
|
||||
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
Reference in New Issue
Block a user