Browse Source

Fix: update tcpip.Address api

pull/260/head
xjasonlyu 1 year ago
parent
commit
3320ba46e4
  1. 4
      tunnel/tcp.go
  2. 4
      tunnel/udp.go

4
tunnel/tcp.go

@ -25,9 +25,9 @@ func handleTCPConn(originConn adapter.TCPConn) {
id := originConn.ID()
metadata := &M.Metadata{
Network: M.TCP,
SrcIP: net.IP(id.RemoteAddress),
SrcIP: net.IP(id.RemoteAddress.AsSlice()),
SrcPort: id.RemotePort,
DstIP: net.IP(id.LocalAddress),
DstIP: net.IP(id.LocalAddress.AsSlice()),
DstPort: id.LocalPort,
}

4
tunnel/udp.go

@ -28,9 +28,9 @@ func handleUDPConn(uc adapter.UDPConn) {
id := uc.ID()
metadata := &M.Metadata{
Network: M.UDP,
SrcIP: net.IP(id.RemoteAddress),
SrcIP: net.IP(id.RemoteAddress.AsSlice()),
SrcPort: id.RemotePort,
DstIP: net.IP(id.LocalAddress),
DstIP: net.IP(id.LocalAddress.AsSlice()),
DstPort: id.LocalPort,
}

Loading…
Cancel
Save