fix: fix wireguard outbound not work with ipv6 server

This commit is contained in:
gVisor bot 2022-12-13 08:23:17 +08:00
parent 122a151ec6
commit 1c86a0f3b7

View file

@ -91,8 +91,7 @@ func NewWireGuard(option WireGuardOption) (*WireGuard, error) {
reserved[1] = uint8(option.Reserved[1])
reserved[2] = uint8(option.Reserved[2])
}
peerAddr := M.ParseSocksaddr(option.Server)
peerAddr.Port = uint16(option.Port)
peerAddr := M.ParseSocksaddrHostPort(option.Server, uint16(option.Port))
outbound.bind = wireguard.NewClientBind(context.Background(), outbound.dialer, peerAddr, reserved)
localPrefixes := make([]netip.Prefix, 0, 2)
if len(option.Ip) > 0 {