Maint: common no port forwarding implementation

This commit is contained in:
Quentin McGaw (desktop)
2021-07-26 16:29:40 +00:00
parent d7a6caa2ac
commit 49885c63c4
33 changed files with 128 additions and 288 deletions

View File

@@ -1,16 +0,0 @@
package nordvpn
import (
"context"
"net"
"net/http"
"github.com/qdm12/gluetun/internal/firewall"
"github.com/qdm12/golibs/logging"
)
func (n *Nordvpn) 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 NordVPN")
}

View File

@@ -3,17 +3,21 @@ package nordvpn
import (
"math/rand"
"github.com/qdm12/gluetun/internal/constants"
"github.com/qdm12/gluetun/internal/models"
"github.com/qdm12/gluetun/internal/provider/utils"
)
type Nordvpn struct {
servers []models.NordvpnServer
randSource rand.Source
utils.NoPortForwarder
}
func New(servers []models.NordvpnServer, randSource rand.Source) *Nordvpn {
return &Nordvpn{
servers: servers,
randSource: randSource,
servers: servers,
randSource: randSource,
NoPortForwarder: utils.NewNoPortForwarding(constants.Nordvpn),
}
}