netmaker/nm-proxy/proxy/proxy.go

35 lines
546 B
Go
Raw Normal View History

package proxy
import (
"context"
"net"
2022-10-27 19:50:06 +08:00
"github.com/gravitl/netmaker/nm-proxy/wg"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)
const (
defaultBodySize = 10000
defaultPort = 51722
)
type Config struct {
Port int
BodySize int
Addr string
RemoteKey string
WgInterface *wg.WGIface
AllowedIps []net.IPNet
PreSharedKey *wgtypes.Key
}
// Proxy - WireguardProxy proxies
type Proxy struct {
Ctx context.Context
Cancel context.CancelFunc
Config Config
RemoteConn net.Conn
LocalConn net.Conn
}