mirror of
https://github.com/e1732a364fed/v2ray_simple.git
synced 2025-12-24 13:27:56 +08:00
@@ -94,7 +94,7 @@ func ReadFromUDP(conn *net.UDPConn, b []byte) (n int, srcAddr *net.UDPAddr, dstA
|
||||
}
|
||||
|
||||
if dstAddr == nil {
|
||||
err = fmt.Errorf("unable to obtain original destination: %s", err)
|
||||
err = fmt.Errorf("unable to obtain original destination: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ func udpAddrFamily(net string, laddr, raddr *net.UDPAddr) int {
|
||||
}
|
||||
|
||||
if (laddr == nil || laddr.IP.To4() != nil) &&
|
||||
(raddr == nil || laddr.IP.To4() != nil) {
|
||||
(raddr == nil || raddr.IP.To4() != nil) { //https://github.com/LiamHaworth/go-tproxy/pull/10/commits/27be77df6d4f2cd145cde56f8b84711600dabbe4
|
||||
return syscall.AF_INET
|
||||
}
|
||||
return syscall.AF_INET6
|
||||
|
||||
@@ -478,7 +478,7 @@ func (u *ServerUDPConn) ReadMsgFrom() ([]byte, netLayer.Addr, error) {
|
||||
|
||||
atyp := bs[3]
|
||||
|
||||
l := 2 //supposed Minimum Remain Data Lenth
|
||||
l := 2 //supposed Minimum Remain Data Lenth, 包含Port的2字节
|
||||
off := 4 //offset from which the addr data really starts
|
||||
|
||||
var theIP net.IP
|
||||
|
||||
Reference in New Issue
Block a user