mirror of
https://github.com/netbirdio/netbird.git
synced 2025-02-17 10:41:37 +01:00
EBPF proxy between TURN (relay) and WireGuard to reduce number of used ports used by the NetBird agent. - Separate the wg configuration from the proxy logic - In case if eBPF type proxy has only one single proxy instance - In case if the eBPF is not supported fallback to the original proxy Implementation Between the signature of eBPF type proxy and original proxy has differences so this is why the factory structure exists
20 lines
324 B
Go
20 lines
324 B
Go
package wgproxy
|
|
|
|
import (
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func NewFactory(wgPort int) *Factory {
|
|
f := &Factory{wgPort: wgPort}
|
|
|
|
ebpfProxy := NewWGEBPFProxy(wgPort)
|
|
err := ebpfProxy.Listen()
|
|
if err != nil {
|
|
log.Errorf("failed to initialize ebpf proxy: %s", err)
|
|
return f
|
|
}
|
|
|
|
f.ebpfProxy = ebpfProxy
|
|
return f
|
|
}
|