1
0
Atzarojums 0
spoguļota no https://github.com/XTLS/Xray-core.git sinhronizēta 2025-07-01 23:54:16 +00:00

Add PROXY Protocol support for freedom outbound

Šis iesūtījums ir iekļauts:
Iain Lau 2024-02-03 09:10:23 +08:00 iesūtīja yuhan6665
vecāks b56917fde5
iesūtījums 3a99520370
5 izmainītas datnes ar 80 papildinājumiem un 22 izdzēšanām

Apskatīt datni

@ -97,6 +97,35 @@ func (d Destination) NetAddr() string {
return addr
}
// RawNetAddr converts a net.Addr from its Destination presentation.
func (d Destination) RawNetAddr() net.Addr {
var addr net.Addr
switch d.Network {
case Network_TCP:
if d.Address.Family().IsIP() {
addr = &net.TCPAddr{
IP: d.Address.IP(),
Port: int(d.Port),
}
}
case Network_UDP:
if d.Address.Family().IsIP() {
addr = &net.UDPAddr{
IP: d.Address.IP(),
Port: int(d.Port),
}
}
case Network_UNIX:
if d.Address.Family().IsDomain() {
addr = &net.UnixAddr{
Name: d.Address.String(),
Net: d.Network.SystemString(),
}
}
}
return addr
}
// String returns the strings form of this Destination.
func (d Destination) String() string {
prefix := "unknown:"