bind

package
v0.83.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: BSD-3-Clause Imports: 10 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bind added in v0.59.0

type Bind interface {
	SetEndpoint(addr netip.Addr, conn net.Conn)
	RemoveEndpoint(addr netip.Addr)
	ReceiveFromEndpoint(ctx context.Context, ep *bind.Endpoint, buf []byte)
}

type ProxyBind

type ProxyBind struct {
	// contains filtered or unexported fields
}

func NewProxyBind added in v0.51.0

func NewProxyBind(bind Bind, mtu uint16) *ProxyBind

func (*ProxyBind) AddRelayedConn added in v0.77.1

func (p *ProxyBind) AddRelayedConn(ctx context.Context, nbAddr *net.UDPAddr, remoteConn net.Conn) error

AddRelayedConn adds a new connection to the bind. endpoint is the NetBird address of the remote peer. The SetEndpoint return with the address what will be used in the WireGuard configuration.

Parameters:

  • ctx: Context is used for proxyToLocal to avoid unnecessary error messages
  • nbAddr: The NetBird UDP address of the remote peer, it required to generate fake address
  • remoteConn: The established relayed connection to the remote peer

func (*ProxyBind) CloseConn

func (p *ProxyBind) CloseConn() error

func (*ProxyBind) EndpointAddr

func (p *ProxyBind) EndpointAddr() *net.UDPAddr

func (*ProxyBind) InjectPacket added in v0.74.0

func (p *ProxyBind) InjectPacket(_ []byte) error

InjectPacket is a no-op for the userspace proxy: first-packet reinjection is kernel-only.

func (*ProxyBind) Pause

func (p *ProxyBind) Pause()

func (*ProxyBind) RedirectAs added in v0.59.0

func (p *ProxyBind) RedirectAs(endpoint *net.UDPAddr)

func (*ProxyBind) SetDisconnectListener added in v0.51.0

func (p *ProxyBind) SetDisconnectListener(disconnected func())

func (*ProxyBind) Work

func (p *ProxyBind) Work()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL