mirror of
https://github.com/netbirdio/netbird.git
synced 2025-03-02 08:51:12 +01:00
25 lines
424 B
Go
25 lines
424 B
Go
|
package proxy
|
||
|
|
||
|
import (
|
||
|
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
||
|
"io"
|
||
|
"net"
|
||
|
"time"
|
||
|
)
|
||
|
|
||
|
const DefaultWgKeepAlive = 25 * time.Second
|
||
|
|
||
|
type Config struct {
|
||
|
WgListenAddr string
|
||
|
RemoteKey string
|
||
|
WgInterface string
|
||
|
AllowedIps string
|
||
|
PreSharedKey *wgtypes.Key
|
||
|
}
|
||
|
|
||
|
type Proxy interface {
|
||
|
io.Closer
|
||
|
// Start creates a local remoteConn and starts proxying data from/to remoteConn
|
||
|
Start(remoteConn net.Conn) error
|
||
|
}
|