From 34e8f5f3a912d299925d293080ded245155433fb Mon Sep 17 00:00:00 2001 From: Quentin McGaw Date: Thu, 1 Aug 2024 11:52:38 +0000 Subject: [PATCH] hotfix(custom): assume all custom servers support port forwarding - Fix custom wireguard with the protonvpn port forwarding implementation - Might fix #2389 --- internal/provider/custom/connection.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/internal/provider/custom/connection.go b/internal/provider/custom/connection.go index 38a16a2d..7ca057f5 100644 --- a/internal/provider/custom/connection.go +++ b/internal/provider/custom/connection.go @@ -40,11 +40,12 @@ func getOpenVPNConnection(extractor Extractor, connection.Port = customPort } + // assume all custom provider servers support port forwarding + connection.PortForward = true if len(selection.Names) > 0 { // Set the server name for PIA port forwarding code used // together with the custom provider. connection.ServerName = selection.Names[0] - connection.PortForward = true } return connection, nil @@ -53,17 +54,17 @@ func getOpenVPNConnection(extractor Extractor, func getWireguardConnection(selection settings.ServerSelection) ( connection models.Connection) { connection = models.Connection{ - Type: vpn.Wireguard, - IP: selection.Wireguard.EndpointIP, - Port: *selection.Wireguard.EndpointPort, - Protocol: constants.UDP, - PubKey: selection.Wireguard.PublicKey, + Type: vpn.Wireguard, + IP: selection.Wireguard.EndpointIP, + Port: *selection.Wireguard.EndpointPort, + Protocol: constants.UDP, + PubKey: selection.Wireguard.PublicKey, + PortForward: true, // assume all custom provider servers support port forwarding } if len(selection.Names) > 0 { // Set the server name for PIA port forwarding code used // together with the custom provider. connection.ServerName = selection.Names[0] - connection.PortForward = true } return connection }