traversalv2

package
v0.0.0-...-40131ec Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func BuilderDemo

func BuilderDemo(serverAddr string, natType int8) (*Client, error)

func NewClient

func NewClient(serverAddr string, natType int8, holePunchHandler holepunch.HolePunchHandler) *Client

func (*Client) Close

func (c *Client) Close()

func (*Client) HolePunching

func (c *Client) HolePunching(ctx context.Context, token string) (*HolePunchResult, error)

type ConnectFactory

type ConnectFactory interface {
	Connect(localAddr string, remoteAddr string, isActive bool) error
}

type DemoConnectFactory

type DemoConnectFactory struct{}

func (*DemoConnectFactory) Connect

func (d *DemoConnectFactory) Connect(localAddr string, remoteAddr string, isActive bool) error

type HolePunchResult

type HolePunchResult struct {
	LocalAddr  string `json:"local_addr"`
	RemoteAddr string `json:"remote_addr"`
	LocalPort  int    `json:"local_port"`
	RemotePort int    `json:"remote_port"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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