Maint: common no port forwarding implementation
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
package protonvpn
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net"
|
||||
"net/http"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/firewall"
|
||||
"github.com/qdm12/golibs/logging"
|
||||
)
|
||||
|
||||
func (p *Protonvpn) PortForward(ctx context.Context, client *http.Client,
|
||||
pfLogger logging.Logger, gateway net.IP, portAllower firewall.PortAllower,
|
||||
syncState func(port uint16) (pfFilepath string)) {
|
||||
panic("port forwarding is not supported for ProtonVPN")
|
||||
}
|
||||
@@ -3,17 +3,21 @@ package protonvpn
|
||||
import (
|
||||
"math/rand"
|
||||
|
||||
"github.com/qdm12/gluetun/internal/constants"
|
||||
"github.com/qdm12/gluetun/internal/models"
|
||||
"github.com/qdm12/gluetun/internal/provider/utils"
|
||||
)
|
||||
|
||||
type Protonvpn struct {
|
||||
servers []models.ProtonvpnServer
|
||||
randSource rand.Source
|
||||
utils.NoPortForwarder
|
||||
}
|
||||
|
||||
func New(servers []models.ProtonvpnServer, randSource rand.Source) *Protonvpn {
|
||||
return &Protonvpn{
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
servers: servers,
|
||||
randSource: randSource,
|
||||
NoPortForwarder: utils.NewNoPortForwarding(constants.Protonvpn),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user