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.
This commit is contained in:
Mikhail Bragin 2022-03-02 14:50:22 +01:00 committed by GitHub
parent b72ed91cb4
commit 430e0415df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
}