server

package
v2.1.6 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package server implements the private API to implement a TURN server

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleRequest

func HandleRequest(r Request) error

HandleRequest processes the give Request

Types

type NonceHash added in v2.1.5

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

NonceHash is used to create and verify nonces

func NewNonceHash added in v2.1.5

func NewNonceHash() (*NonceHash, error)

NewNonceHash creates a NonceHash

func (*NonceHash) Generate added in v2.1.5

func (n *NonceHash) Generate() (string, error)

Generate a nonce

func (*NonceHash) Validate added in v2.1.5

func (n *NonceHash) Validate(nonce string) error

Validate checks that nonce is signed and is not expired

type Request

type Request struct {
	// Current Request State
	Conn    net.PacketConn
	SrcAddr net.Addr
	Buff    []byte

	// Server State
	AllocationManager *allocation.Manager
	NonceHash         *NonceHash

	// User Configuration
	AuthHandler        func(username string, realm string, srcAddr net.Addr) (key []byte, ok bool)
	Log                logging.LeveledLogger
	Realm              string
	ChannelBindTimeout time.Duration
}

Request contains all the state needed to process a single incoming datagram

Jump to

Keyboard shortcuts

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