forwarder

package module
v0.0.0-...-6cef876 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Relay

func Relay(conn *net.UDPConn, zero net.Addr, log golog.Logger) error

Types

type Allocator

type Allocator interface {
	Init(ping func(relay netip.AddrPort, data []byte) error) error
	Release()
	Pong(bridge netip.AddrPort, data []byte) error
	Addr() *addr.Addr
}

type Client

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

func Listen

func Listen(network string, local netip.AddrPort, allocator Allocator, logger log.Logger) (*Client, error)

func Wrap

func Wrap(udp *net.UDPConn, allocator Allocator, logger log.Logger) (_ *Client, err error)

func (*Client) Close

func (c *Client) Close() error

func (*Client) LocalAddr

func (c *Client) LocalAddr() net.Addr

func (*Client) ReadFrom

func (c *Client) ReadFrom(p []byte) (int, net.Addr, error)

func (*Client) SetDeadline

func (c *Client) SetDeadline(t time.Time) error

func (*Client) SetReadDeadline

func (c *Client) SetReadDeadline(t time.Time) error

func (*Client) SetWriteDeadline

func (c *Client) SetWriteDeadline(t time.Time) error

func (*Client) WriteTo

func (c *Client) WriteTo(p []byte, netAddr net.Addr) (n int, err error)

Directories

Path Synopsis
cmd
internal
pkg

Jump to

Keyboard shortcuts

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