relay

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProbeSTUN

func ProbeSTUN(ctx context.Context, uri *stun.URI) (addr string, probeErr error)

ProbeSTUN tries binding to the given STUN uri and acquiring an address

func ProbeTURN

func ProbeTURN(ctx context.Context, uri *stun.URI) (addr string, probeErr error)

ProbeTURN tries allocating a session from the given TURN URI

Types

type ProbeResult

type ProbeResult struct {
	URI  *stun.URI
	Err  error
	Addr string
}

ProbeResult holds the info about the result of a relay probe request

func ProbeAll

func ProbeAll(
	ctx context.Context,
	fn func(ctx context.Context, uri *stun.URI) (addr string, probeErr error),
	relays []*stun.URI,
) []ProbeResult

ProbeAll probes all given servers asynchronously and returns the results

Jump to

Keyboard shortcuts

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