stun

package
v1.3.110 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package stun pkg/services/stun/stun.go c2-vis-appsvc

stun-server as a pkg/services.Service. Implements RFC 3489 NAT discovery; requires two distinct IPs for full NAT-type detection (the `change-address` STUN attribute path needs the secondary).

Index

Constants

View Source
const Type = "stun-server"

Type is the registry key used in services.json blocks.

Variables

This section is empty.

Functions

func New

func New(cfg *Config, log *logging.Logger) services.Service

New builds a Service from an already-parsed Config.

Types

type Config

type Config struct {
	PrimaryIP   string `json:"primary_ip"`
	SecondaryIP string `json:"secondary_ip"`
	Port        int    `json:"port,omitempty"`     // default 3478
	AltPort     int    `json:"alt_port,omitempty"` // default 3479
	LogLevel    string `json:"log_level,omitempty"`
	Tag         string `json:"tag,omitempty"`
}

Config is the JSON configuration for the STUN server. Tiny — stun-server has no redis, no dmsg, no svcmode listener.

func ParseBlock

func ParseBlock(raw []byte) (*Config, error)

ParseBlock decodes a services.json block into a Config.

Jump to

Keyboard shortcuts

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