feat(protonvpn): support up to 5 forwarded ports (#3208)

This commit is contained in:
Quentin McGaw
2026-04-18 02:36:06 +02:00
committed by GitHub
parent 7e7e8182ef
commit d5eeec6fb3
17 changed files with 254 additions and 109 deletions
+3 -2
View File
@@ -22,7 +22,7 @@ var ErrPortForwardedNotFound = errors.New("port forwarded not found")
// PortForward obtains a VPN server side port forwarded from the PrivateVPN API.
// It returns 0 if all ports are to forwarded on a dedicated server IP.
func (p *Provider) PortForward(ctx context.Context, objects utils.PortForwardObjects) (
ports []uint16, err error,
internalToExternalPorts map[uint16]uint16, err error,
) {
// Define a timeout since the default client has a large timeout and we don't
// want to wait too long.
@@ -75,7 +75,8 @@ func (p *Provider) PortForward(ctx context.Context, objects utils.PortForwardObj
if err != nil {
return nil, fmt.Errorf("parsing port: %w", err)
}
return []uint16{uint16(portUint64)}, nil
port := uint16(portUint64)
return map[uint16]uint16{port: port}, nil
}
func (p *Provider) KeepPortForward(ctx context.Context,