Change: use uint16 for Metadata SrcPort and DstPort

This commit is contained in:
Dreamacro
2023-08-03 23:20:40 +08:00
parent 47b6eb1700
commit c0e51f8556
13 changed files with 63 additions and 58 deletions

View File

@@ -354,12 +354,11 @@ func parseVmessAddr(metadata *C.Metadata) *vmess.DstAddr {
copy(addr[1:], []byte(metadata.Host))
}
port, _ := strconv.ParseUint(metadata.DstPort, 10, 16)
return &vmess.DstAddr{
UDP: metadata.NetWork == C.UDP,
AddrType: addrType,
Addr: addr,
Port: uint(port),
Port: uint(metadata.DstPort),
}
}