diff options
Diffstat (limited to 'exports')
| -rw-r--r-- | exports/exports.go | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/exports/exports.go b/exports/exports.go index f2fa75e..3c9c59a 100644 --- a/exports/exports.go +++ b/exports/exports.go @@ -912,6 +912,22 @@ func NewProxyguard(c C.uintptr_t, lp C.int, tcpsp C.int, peer *C.char, proxySetu return C.uintptr_t(cgo.NewHandle(proxy)), nil } +// ProxyguardRestart restarts ProxyGuard, call this when a network change happens +// +// Example Input: ```ProxyguardRestart(proxyHandle)``` +// +// Example Output: ```"failed restarting ProxyGuard"``` +// +//export ProxyguardRestart +func ProxyguardRestart(proxyH C.uintptr_t) *C.char { + pr, err := getProxy(proxyH) + if err != nil { + return getCError(err) + } + pr.Restart() + return nil +} + func getProxy(proxyH C.uintptr_t) (*proxy.Proxy, error) { h := cgo.Handle(proxyH) v, ok := h.Value().(*proxy.Proxy) |
