nat

package
v2.9.2 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2024 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NATUnknown      = "unknown"
	NATRestricted   = "restricted"
	NATUnrestricted = "unrestricted"
)

Variables

View Source
var ErrTimedOut = errors.New("timed out waiting for response")

Functions

func CheckIfRestrictedNAT deprecated

func CheckIfRestrictedNAT(server string) (bool, error)

Deprecated: Use CheckIfRestrictedNATWithProxy Instead.

func CheckIfRestrictedNATWithProxy added in v2.8.0

func CheckIfRestrictedNATWithProxy(server string, proxy *url.URL) (bool, error)

CheckIfRestrictedNATWithProxy checks the NAT mapping and filtering behaviour and returns true if the NAT is restrictive (address-dependent mapping and/or port-dependent filtering) and false if the NAT is unrestrictive (meaning it will work with most other NATs),

Types

type StunServerConn

type StunServerConn struct {
	PrimaryAddr *net.UDPAddr
	OtherAddr   *net.UDPAddr
	// contains filtered or unexported fields
}

func (*StunServerConn) AddOtherAddr

func (c *StunServerConn) AddOtherAddr(addrStr string) error

func (*StunServerConn) Close

func (c *StunServerConn) Close()

func (*StunServerConn) RoundTrip

func (c *StunServerConn) RoundTrip(msg *stun.Message, addr net.Addr) (*stun.Message, error)

Jump to

Keyboard shortcuts

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