stun

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ListenAddr string
	PublicAddr string
}

Config controls the STUN server. ListenAddr is the local UDP address to bind, e.g. ":3478". PublicAddr is the host:port that clients should use to reach this server (IP or DNS name plus port). It is used for generating ICE server URLs.

type Server

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

Server is a minimal STUN server implemented using pion/turn's server core. It responds to STUN Binding requests on the configured UDP address. Note: This server does not provide TURN relaying; see the turn package for that.

func (*Server) Close

func (s *Server) Close() error

Close stops the STUN server.

func (*Server) ICEServer

func (s *Server) ICEServer() webrtc.ICEServer

ICEServer returns a webrtc.ICEServer that clients can use to reach this STUN server.

func (*Server) Start

func (s *Server) Start(cfg Config) error

Start launches the STUN server.

Jump to

Keyboard shortcuts

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