stunserver

package
v0.0.0-...-113f59a Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package stunserver implements a STUN server. The package publishes a number of stats to expvar under the top level label "stun". Logs are sent to the standard log package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type STUNServer

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

func New

func New(ctx context.Context) *STUNServer

New creates a new STUN server. The server is shutdown when ctx is done.

func (*STUNServer) Listen

func (s *STUNServer) Listen(listenAddr string) error

Listen binds the listen socket for the server at listenAddr.

func (*STUNServer) ListenAndServe

func (s *STUNServer) ListenAndServe(listenAddr string) error

ListenAndServe starts the STUN server on listenAddr.

func (*STUNServer) LocalAddr

func (s *STUNServer) LocalAddr() net.Addr

LocalAddr returns the local address of the STUN server. It must not be called before ListenAndServe.

func (*STUNServer) Serve

func (s *STUNServer) Serve() error

Serve starts serving responses to STUN requests. Listen must be called before Serve.

Jump to

Keyboard shortcuts

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