Proposal for code cleaning

This commit is contained in:
Zoltan Papp
2023-04-11 17:06:55 +02:00
parent 9b9f5fb64b
commit ca10541f50
9 changed files with 62 additions and 66 deletions

View File

@@ -1,15 +1,10 @@
package proxy
import (
"github.com/netbirdio/netbird/iface"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"io"
"net"
"time"
)
const DefaultWgKeepAlive = 25 * time.Second
type Type string
const (
@@ -19,14 +14,6 @@ const (
TypeNoProxy Type = "NoProxy"
)
type Config struct {
WgListenAddr string
RemoteKey string
WgInterface *iface.WGIface
AllowedIps string
PreSharedKey *wgtypes.Key
}
type Proxy interface {
io.Closer
// Start creates a local remoteConn and starts proxying data from/to remoteConn