diff options
| author | Jeroen Wijenbergh <jeroen.wijenbergh@geant.org> | 2025-05-06 12:35:21 +0200 |
|---|---|---|
| committer | Jeroen Wijenbergh <jeroen.wijenbergh@geant.org> | 2025-05-06 12:35:21 +0200 |
| commit | 9c4985368aee638d982f30ea7bc5c7ee71ae3ab3 (patch) | |
| tree | 10b0bd88547c366b05404419b9e7dee1b1a1e270 /proxy | |
| parent | cd4e5a23852ca5f9af7f66f1daa9dfbf7d8e7376 (diff) | |
All: Fix staticcheck errors
Diffstat (limited to 'proxy')
| -rw-r--r-- | proxy/proxy.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/proxy/proxy.go b/proxy/proxy.go index 7a35c8d..a43083f 100644 --- a/proxy/proxy.go +++ b/proxy/proxy.go @@ -1,4 +1,4 @@ -// package proxy is a wrapper around proxyguard that integrates it with eduvpn-common settings +// Package proxy is a wrapper around proxyguard that integrates it with eduvpn-common settings // - leaves out some options not applicable to the common integration, e.g. fwmark // - integrates with eduvpn-common's logger // - integrates eduvpn-common's user agent @@ -27,6 +27,7 @@ func (l *Logger) Log(msg string) { log.Logger.Infof("[Proxyguard] %s", msg) } +// Proxy is the ProxyGuard client with a channel used for restarting type Proxy struct { proxyguard.Client resChan chan struct{} @@ -45,7 +46,7 @@ func NewProxyguard(ctx context.Context, lp int, tcpsp int, peer string, setupSoc }, resChan: make(chan struct{}), } - _, err := proxy.Client.Setup(ctx) + _, err := proxy.Setup(ctx) if err != nil { return nil, i18nerr.WrapInternal(err, "The ProxyGuard DNS could not be resolved") } @@ -53,6 +54,7 @@ func NewProxyguard(ctx context.Context, lp int, tcpsp int, peer string, setupSoc return &proxy, nil } +// Tunnel tunnels the ProxyGuard connection. `wglisten` is the WireGuard listen port func (p *Proxy) Tunnel(ctx context.Context, wglisten int) error { log.Logger.Infof("callying tunnel") errChan := make(chan error, 1) @@ -76,6 +78,7 @@ func (p *Proxy) Tunnel(ctx context.Context, wglisten int) error { } } +// Restart restarts the existing ProxyGuard process, for e.g. roaming func (p *Proxy) Restart() { p.resChan <- struct{}{} } |
