feat(protonvpn): port forwarding support with NAT-PMP (#1543)

Co-authored-by: Nicholas Xavier <nicho@nicho.dev>
This commit is contained in:
Quentin McGaw
2023-06-30 20:09:44 +02:00
committed by GitHub
parent fae6544431
commit 8ad16cdc12
19 changed files with 1118 additions and 17 deletions

View File

@@ -40,7 +40,10 @@ func (p PortForwarding) validate(vpnProvider string) (err error) {
if *p.Provider != "" {
providerSelected = *p.Provider
}
validProviders := []string{providers.PrivateInternetAccess}
validProviders := []string{
providers.PrivateInternetAccess,
providers.Protonvpn,
}
if err = validate.IsOneOf(providerSelected, validProviders...); err != nil {
return fmt.Errorf("%w: %w", ErrPortForwardingEnabled, err)
}

View File

@@ -16,7 +16,7 @@ type WireguardSelection struct {
// It is only used with VPN providers generating Wireguard
// configurations specific to each server and user.
// To indicate it should not be used, it should be set
// to netaddr.IPv4Unspecified(). It can never be the zero value
// to netip.IPv4Unspecified(). It can never be the zero value
// in the internal state.
EndpointIP netip.Addr `json:"endpoint_ip"`
// EndpointPort is a the server port to use for the VPN server.