config

package
v0.5.17 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultTURNServers = []TURNServer{
	{URL: "turn:openrelay.metered.ca:80", Username: "openrelayproject", Credential: "openrelayproject"},
	{URL: "turn:openrelay.metered.ca:443", Username: "openrelayproject", Credential: "openrelayproject"},
	{URL: "turns:openrelay.metered.ca:443", Username: "openrelayproject", Credential: "openrelayproject"},
}

DefaultTURNServers are free public TURN relays used when no custom servers are configured. Traffic is DTLS-encrypted end-to-end; the relay sees packet sizes/IPs but not content.

Functions

func DefaultPath

func DefaultPath() string

Types

type Config

type Config struct {
	Nickname      string `json:"nickname"`
	DataDir       string `json:"data_dir"`
	PrivateKeyB64 string `json:"private_key_b64,omitempty"`
	// EnableBLEWebRTC allows macOS BLE discovery to upgrade the data path to WebRTC.
	// Keep false when BLE must be the only cross-network channel.
	EnableBLEWebRTC bool `json:"enable_ble_webrtc,omitempty"`
	// TURNServers overrides the built-in Open Relay servers when non-empty.
	// Set to your own coturn instance for full privacy.
	TURNServers []TURNServer `json:"turn_servers,omitempty"`
}

func Load

func Load(path string) (*Config, error)

func (*Config) ICEServers added in v0.3.2

func (c *Config) ICEServers() []TURNServer

ICEServers returns the TURN servers to use: custom if configured, otherwise defaults.

func (*Config) Save

func (c *Config) Save(path string) error

type TURNServer added in v0.3.2

type TURNServer struct {
	URL        string `json:"url"`
	Username   string `json:"username"`
	Credential string `json:"credential"`
}

TURNServer holds credentials for a TURN relay server.

Jump to

Keyboard shortcuts

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