nat

package
v0.0.0-...-365054f Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AppTopicNATTraversalMethod represent NAT traversal method topic.
	AppTopicNATTraversalMethod = "NAT-traversal-method"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NATTraversalMethod

type NATTraversalMethod struct {
	Identity string
	Method   string
	Success  bool
}

NATTraversalMethod represents information about NAT traversal methods results.

type NamedPortProvider

type NamedPortProvider struct {
	Method   string
	Provider PortProvider
}

NamedPortProvider contains information of the NAT traversal method.

func OrderedPortProviders

func OrderedPortProviders() (list []NamedPortProvider)

OrderedPortProviders returns a ordered list of the port providers.

type PortProvider

type PortProvider interface {
	PreparePorts() (ports []int, release func(), start StartPorts, err error)
}

PortProvider describes an method for provideing ports for the service.

func NewManualPortProvider

func NewManualPortProvider() PortProvider

NewManualPortProvider creates new instance of the manual port provider.

func NewNATHolePunchingPortProvider

func NewNATHolePunchingPortProvider() PortProvider

NewNATHolePunchingPortProvider creates new instance of the NAT hole punching port provider.

func NewUPnPPortProvider

func NewUPnPPortProvider() PortProvider

NewUPnPPortProvider returns a new instance of the UPnP port provider.

type StartPorts

type StartPorts func(ctx context.Context, peerIP string, peerPorts, localPorts []int) ([]*net.UDPConn, error)

StartPorts starts the process of serving connections for the provided ports.

Jump to

Keyboard shortcuts

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