forwarder

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UDPConnTrackTimeout is the timeout used for UDP connection tracking
	UDPConnTrackTimeout = 90 * time.Second
	// UDPBufSize is the buffer size for the UDP proxy
	UDPBufSize = 65507
)

Variables

This section is empty.

Functions

func TCP

func TCP(s *stack.Stack, nat map[tcpip.Address]tcpip.Address, natLock *sync.Mutex) *tcp.Forwarder

func UDP

func UDP(s *stack.Stack, nat map[tcpip.Address]tcpip.Address, natLock *sync.Mutex) *udp.Forwarder

Types

type CloseWrapper added in v0.4.0

type CloseWrapper func() error

func (CloseWrapper) Close added in v0.4.0

func (w CloseWrapper) Close() error

type PortsForwarder

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

func NewPortsForwarder

func NewPortsForwarder(s *stack.Stack) *PortsForwarder

func (*PortsForwarder) Expose

func (f *PortsForwarder) Expose(protocol types.TransportProtocol, local, remote string) error

func (*PortsForwarder) Mux

func (f *PortsForwarder) Mux() http.Handler

func (*PortsForwarder) Unexpose

func (f *PortsForwarder) Unexpose(protocol types.TransportProtocol, local string) error

type UDPProxy added in v0.2.0

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

UDPProxy is proxy for which handles UDP datagrams. It implements the Proxy interface to handle UDP traffic forwarding between the frontend and backend addresses.

func NewUDPProxy added in v0.2.0

func NewUDPProxy(listener udpConn, dialer func() (net.Conn, error)) (*UDPProxy, error)

NewUDPProxy creates a new UDPProxy.

func (*UDPProxy) Close added in v0.2.0

func (proxy *UDPProxy) Close() error

Close stops forwarding the traffic.

func (*UDPProxy) Run added in v0.2.0

func (proxy *UDPProxy) Run()

Run starts forwarding the traffic using UDP.

Jump to

Keyboard shortcuts

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