turn

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package turn holds the TURN dialer of mediactl: conns to peers relayed through a TURN server, over a UDP allocation or an RFC 6062 TCP connection.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialer

type Dialer struct {
	// URI is the TURN server, turn:<host>:<port>?transport=udp|tcp, or turns: for TLS and DTLS.
	URI string
	// Username and Password are the long-term credentials, none if empty.
	Username, Password string
	// Insecure skips the verification of the TURN server's certificate.
	Insecure bool
	// LoggerFactory makes the TURN client's logger; nil logs nothing.
	LoggerFactory logging.LoggerFactory
}

Dialer opens conns to peers relayed through a TURN server.

func (Dialer) DialContext

func (d Dialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

DialContext opens a conn to the peer at address through the TURN server: what it reads comes from the peer, what it writes goes to the peer, its local address is the relayed address. The network "tcp" relays over an RFC 6062 TCP connection, which needs a TCP or TLS transport, any other network over a UDP allocation. Closing the conn ends the TURN session.

Jump to

Keyboard shortcuts

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