2024-10-22 20:53:14 +02:00
|
|
|
package wgproxy
|
|
|
|
|
|
|
|
import (
|
2024-10-24 11:43:14 +02:00
|
|
|
log "github.com/sirupsen/logrus"
|
|
|
|
|
2024-10-22 20:53:14 +02:00
|
|
|
"github.com/netbirdio/netbird/client/iface/bind"
|
|
|
|
proxyBind "github.com/netbirdio/netbird/client/iface/wgproxy/bind"
|
|
|
|
)
|
|
|
|
|
|
|
|
type USPFactory struct {
|
|
|
|
bind *bind.ICEBind
|
|
|
|
}
|
|
|
|
|
|
|
|
func NewUSPFactory(iceBind *bind.ICEBind) *USPFactory {
|
2024-10-24 11:43:14 +02:00
|
|
|
log.Infof("WireGuard Proxy Factory will produce bind proxy")
|
2024-10-22 20:53:14 +02:00
|
|
|
f := &USPFactory{
|
|
|
|
bind: iceBind,
|
|
|
|
}
|
|
|
|
return f
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *USPFactory) GetProxy() Proxy {
|
|
|
|
return &proxyBind.ProxyBind{
|
|
|
|
Bind: w.bind,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (w *USPFactory) Free() error {
|
|
|
|
return nil
|
|
|
|
}
|