From 1333f1fd47830c0faf1e3b83eb7367265c7f68a9 Mon Sep 17 00:00:00 2001 From: wwqgtxx Date: Tue, 13 Dec 2022 08:23:17 +0800 Subject: [PATCH] fix: fix wireguard outbound not work with ipv6 server --- adapter/outbound/wireguard.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/adapter/outbound/wireguard.go b/adapter/outbound/wireguard.go index 002b65aa..22eca388 100644 --- a/adapter/outbound/wireguard.go +++ b/adapter/outbound/wireguard.go @@ -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 {