summaryrefslogtreecommitdiff
path: root/proxy/proxy.go
diff options
context:
space:
mode:
Diffstat (limited to 'proxy/proxy.go')
-rw-r--r--proxy/proxy.go7
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{}{}
}