stun

package
v1.14.0-alpha.21 Latest Latest
Warning

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

Go to latest
Published: May 3, 2026 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultServer = "stun.voipgate.com:3478"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NATFiltering

type NATFiltering int32
const (
	NATFilteringUnknown NATFiltering = iota
	NATFilteringEndpointIndependent
	NATFilteringAddressDependent
	NATFilteringAddressAndPortDependent
)

func (NATFiltering) String

func (f NATFiltering) String() string

type NATMapping

type NATMapping int32
const (
	NATMappingUnknown NATMapping = iota

	NATMappingEndpointIndependent
	NATMappingAddressDependent
	NATMappingAddressAndPortDependent
)

func (NATMapping) String

func (m NATMapping) String() string

type Options

type Options struct {
	Server     string
	Dialer     N.Dialer
	Context    context.Context
	OnProgress func(Progress)
}

type Phase

type Phase int32
const (
	PhaseBinding Phase = iota
	PhaseNATMapping
	PhaseNATFiltering
	PhaseDone
)

type Progress

type Progress struct {
	Phase        Phase
	ExternalAddr string
	LatencyMs    int32
	NATMapping   NATMapping
	NATFiltering NATFiltering
}

type Result

type Result struct {
	ExternalAddr     string
	LatencyMs        int32
	NATMapping       NATMapping
	NATFiltering     NATFiltering
	NATTypeSupported bool
}

func Run

func Run(options Options) (*Result, error)

type TransactionID

type TransactionID [12]byte

Jump to

Keyboard shortcuts

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