From 430e0415df822169055c82741e8567bec7de20c0 Mon Sep 17 00:00:00 2001 From: Mikhail Bragin Date: Wed, 2 Mar 2022 14:50:22 +0100 Subject: [PATCH] Remove Wireguard peer in no-proxy mode on Close (#247) When connection is closed the wireguard peer should be gone. It wasn't happening until this fix. --- client/internal/proxy/noproxy.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/internal/proxy/noproxy.go b/client/internal/proxy/noproxy.go index 7f9cae600..c750fd69e 100644 --- a/client/internal/proxy/noproxy.go +++ b/client/internal/proxy/noproxy.go @@ -21,7 +21,10 @@ func NewNoProxy(config Config) *NoProxy { } func (p *NoProxy) Close() error { - // noop + err := p.config.WgInterface.RemovePeer(p.config.RemoteKey) + if err != nil { + return err + } return nil }