mirror of
https://github.com/netbirdio/netbird.git
synced 2025-08-06 22:16:54 +02:00
- Clients now subscribe to peer status changes. - The server manages and maintains these subscriptions. - Replaced raw string peer IDs with a custom peer ID type for better type safety and clarity.
17 lines
585 B
Go
17 lines
585 B
Go
package wgproxy
|
|
|
|
import (
|
|
"context"
|
|
"net"
|
|
)
|
|
|
|
// Proxy is a transfer layer between the relayed connection and the WireGuard
|
|
type Proxy interface {
|
|
AddTurnConn(ctx context.Context, endpoint *net.UDPAddr, remoteConn net.Conn) error
|
|
EndpointAddr() *net.UDPAddr // EndpointAddr returns the address of the WireGuard peer endpoint
|
|
Work() // Work start or resume the proxy
|
|
Pause() // Pause to forward the packages from remote connection to WireGuard. The opposite way still works.
|
|
CloseConn() error
|
|
SetDisconnectListener(disconnected func())
|
|
}
|