connstr

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: May 25, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const Scheme = "goloom://"

Variables

This section is empty.

Functions

func Encode

func Encode(p *Params) (string, error)

Types

type Params

type Params struct {
	Meeting     string `json:"m,omitempty"`
	DisplayName string `json:"n,omitempty"`
	KCPMTU      int    `json:"km,omitempty"`
	KCPSndWnd   int    `json:"ks,omitempty"`
	KCPRcvWnd   int    `json:"kr,omitempty"`
	PSK         string `json:"psk,omitempty"`
	Tag         string `json:"tag,omitempty"`

	// Transport names the SFU/transport implementation to use.
	// Empty == "telemost" for backward compatibility with connstrs
	// generated before multi-transport. Mirrors
	// [github.com/Pinnss/goloom-server/internal/sfu].Kind values.
	Transport string `json:"t,omitempty"`

	// Codec — для VK transport: "vp8" / "h264" / "" (h264 default).
	// Клиент должен совпадать с серверным codec'ом инбаунда.
	Codec string `json:"c,omitempty"`

	// WG-related fields. Populated by the admin panel when an inbound
	// has been auto-provisioned, so the client can build its WG config
	// from a single connection string instead of having the user copy a
	// .conf file separately. Field names kept short to fit a QR.
	WGClientPrivate string `json:"wgcp,omitempty"` // client private key (base64)
	WGServerPublic  string `json:"wgsp,omitempty"` // server public key (base64)
	WGClientAddr    string `json:"wga,omitempty"`  // client tunnel address with prefix, e.g. "10.66.1.2/24"
	WGEndpoint      string `json:"wge,omitempty"`  // endpoint to dial, e.g. "127.0.0.1:51820"
	WGDNS           string `json:"wgd,omitempty"`  // comma-separated DNS list, e.g. "1.1.1.1,8.8.8.8"
}

func Decode

func Decode(s string) (*Params, error)

func (*Params) HasWG

func (p *Params) HasWG() bool

HasWG reports whether the connection string carries a usable embedded WireGuard client config (no manual .conf import needed on the client).

func (*Params) WGClientConfig

func (p *Params) WGClientConfig() string

WGClientConfig renders the embedded WG fields as a wg-quick-compatible config text. Returns "" if HasWG() is false.

Jump to

Keyboard shortcuts

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