turn

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package turn contains the STUN/TURN server.

Index

Constants

View Source
const DefaultListenAddress = "[::]:3478"

DefaultListenAddress is the default listen address for the TURN server.

View Source
const DefaultPortRange = "49152-65535"

DefaultPortRange is the default port range for the TURN server.

View Source
const DefaultRelayAddress = "0.0.0.0"

DefaultRelayAddress is the default relay address for the TURN server.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// PublicIP is the public IP address of the TURN server. This is used for relaying.
	PublicIP string
	// RelayAddressUDP is the binding address the TURN server uses for request handling and STUN relays.
	// Defaults to 0.0.0.0.
	RelayAddressUDP string
	// ListenUDP is the address the TURN server listens on for UDP requests.
	ListenUDP string
	// Realm is the realm used for authentication.
	Realm string
	// PortRange is the range of ports the TURN server will use for relaying.
	PortRange string
}

Options contains the options for the TURN server.

type Server

type Server struct {
	Options
	context.Context
	// contains filtered or unexported fields
}

Server is a TURN server.

func NewServer

func NewServer(ctx context.Context, o Options) *Server

NewServer creates and starts a new TURN server.

func (*Server) ListenAndServe added in v0.3.1

func (s *Server) ListenAndServe() error

ListenAndServe starts the TURN server and blocks until the server exits.

func (*Server) Shutdown added in v0.3.1

func (s *Server) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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