diff options
| author | jwijenbergh <jeroenwijenbergh@protonmail.com> | 2024-02-23 10:35:32 +0100 |
|---|---|---|
| committer | Jeroen Wijenbergh <46386452+jwijenbergh@users.noreply.github.com> | 2024-02-23 10:40:50 +0100 |
| commit | 03ebce3243da4f5a9be6ce8e86152e2b72fd9867 (patch) | |
| tree | 1510e6824d4acefb77545dd411260ca8e3135e10 /client/proxy.go | |
| parent | 174384dfd7457aea1c562b65548f0e5c59b687c5 (diff) | |
Client: Let proxyguard do the DNS request
Diffstat (limited to 'client/proxy.go')
| -rw-r--r-- | client/proxy.go | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/client/proxy.go b/client/proxy.go index 721dcac..c008f56 100644 --- a/client/proxy.go +++ b/client/proxy.go @@ -1,9 +1,6 @@ package client import ( - "net" - "net/url" - "codeberg.org/eduVPN/proxyguard" "github.com/eduvpn/eduvpn-common/i18nerr" "github.com/eduvpn/eduvpn-common/internal/log" @@ -39,17 +36,8 @@ func (c *Client) StartProxyguard(ck *cookie.Cookie, listen string, tcpsp int, pe ready() } - u, err := url.Parse(peer) - if err != nil { - return i18nerr.Wrap(err, "The peer is not a valid URL") - } - - pips, err := net.DefaultResolver.LookupHost(ck.Context(), u.Host) - if err != nil { - return i18nerr.Wrapf(err, "Cannot lookup peer host: '%s'", u.Host) - } - - err = proxyguard.Client(ck.Context(), listen, tcpsp, peer, pips, -1) + // we set peer IPs to nil here as proxyguard already does a DNS request for us + err = proxyguard.Client(ck.Context(), listen, tcpsp, peer, nil, -1) if err != nil { return i18nerr.Wrap(err, "The VPN proxy exited") } |
