stun

package
v1.27.6 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NATError                = stun.NATError
	NATUnknown              = stun.NATUnknown
	NATNone                 = stun.NATNone
	NATBlocked              = stun.NATBlocked
	NATFull                 = stun.NATFull
	NATSymmetric            = stun.NATSymmetric
	NATRestricted           = stun.NATRestricted
	NATPortRestricted       = stun.NATPortRestricted
	NATSymmetricUDPFirewall = stun.NATSymmetricUDPFirewall
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Host

type Host = stun.Host

type LastWriter added in v1.24.0

type LastWriter interface {
	LastWrite() time.Time
}

type NATType

type NATType = stun.NATType

type Service

type Service struct {
	// contains filtered or unexported fields
}

func New

func New(cfg config.Wrapper, subscriber Subscriber, conn net.PacketConn, lastWriter LastWriter) *Service

func (*Service) Serve

func (s *Service) Serve(ctx context.Context) error

func (*Service) String

func (s *Service) String() string

type Subscriber

type Subscriber interface {
	OnNATTypeChanged(natType NATType)
	OnExternalAddressChanged(address *Host, via string)
}

Jump to

Keyboard shortcuts

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