Skip to content

Commit

Permalink
hotfix(custom): assume all custom servers support port forwarding
Browse files Browse the repository at this point in the history
- Fix custom wireguard with the protonvpn port forwarding implementation
- Might fix #2389
  • Loading branch information
qdm12 committed Aug 1, 2024
1 parent ceb6ff4 commit 34e8f5f
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions internal/provider/custom/connection.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}

0 comments on commit 34e8f5f

Please sign in to comment.