nat

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 6 Imported by: 2

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

func CheckIfRestrictedNAT(server string) (bool, error)

This function 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