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.
Click to show internal directories.
Click to hide internal directories.