netmaker/netclient/netclient-proxy/proxy/proxy.go
2022-10-27 15:20:29 +05:30

37 lines
682 B
Go

package proxy
import (
"context"
"net"
"github.com/gravitl/netmaker/netclient/netclient-proxy/server"
"github.com/gravitl/netmaker/netclient/netclient-proxy/wg"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)
const (
defaultBodySize = 10000
defaultPort = 51722
)
type Config struct {
Port int
BodySize int
Addr string
WgListenAddr string
RemoteKey string
WgInterface *wg.WGIface
AllowedIps []net.IPNet
PreSharedKey *wgtypes.Key
ProxyServer *server.ProxyServer
}
// Proxy - WireguardProxy proxies
type Proxy struct {
Ctx context.Context
Cancel context.CancelFunc
Config Config
RemoteConn net.Conn
LocalConn net.Conn
}