stun

package
v0.0.0-...-f9f7919 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServe

func ListenAndServe(address string, log *zap.Logger) error

func NextServer

func NextServer() string

func Request

func Request(logger *zap.SugaredLogger, stunSvr string, srcPort int) (netip.AddrPort, error)

func RequestWithReusePort

func RequestWithReusePort(logger *zap.SugaredLogger, stunServer string, srcPort int) (netip.AddrPort, error)

func SetServers

func SetServers(servers []string)

Types

type ClosableServer

type ClosableServer struct {
	Server
	Port int
	// contains filtered or unexported fields
}

func ListenAndStart

func ListenAndStart(address string, log *zap.Logger) (*ClosableServer, error)

func (*ClosableServer) Close

func (s *ClosableServer) Close() error

func (*ClosableServer) Shutdown

func (s *ClosableServer) Shutdown() error

type Server

type Server struct {
	Log *zap.Logger
}

func (*Server) Serve

func (s *Server) Serve(conn net.PacketConn) error

Jump to

Keyboard shortcuts

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