udp

package
v0.35.1 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WGUDPProxy

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

WGUDPProxy proxies

func NewWGUDPProxy

func NewWGUDPProxy(wgPort int) *WGUDPProxy

NewWGUDPProxy instantiate a UDP based WireGuard proxy. This is not a thread safe implementation

func (*WGUDPProxy) AddTurnConn

func (p *WGUDPProxy) AddTurnConn(ctx context.Context, endpoint *net.UDPAddr, remoteConn net.Conn) error

AddTurnConn The provided Context must be non-nil. If the context expires before the connection is complete, an error is returned. Once successfully connected, any expiration of the context will not affect the connection.

func (*WGUDPProxy) CloseConn

func (p *WGUDPProxy) CloseConn() error

CloseConn close the localConn

func (*WGUDPProxy) EndpointAddr

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

func (*WGUDPProxy) Pause

func (p *WGUDPProxy) Pause()

Pause pauses the proxy from receiving data from the remote peer

func (*WGUDPProxy) Work

func (p *WGUDPProxy) Work()

Work starts the proxy or resumes it if it was paused

Jump to

Keyboard shortcuts

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