stun

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 9 Imported by: ? 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

This section is empty.

Variables

View Source
var (
	StunServers = []StunServer{
		{Domain: "stun1.l.google.com", Port: 19302},
		{Domain: "stun2.l.google.com", Port: 19302},
		{Domain: "stun3.l.google.com", Port: 19302},
		{Domain: "stun4.l.google.com", Port: 19302},
	}
)

Functions

func DoesIPExistLocally

func DoesIPExistLocally(ip net.IP) bool

DoesIPExistLocally - checks if the IP address exists on a local interface

func HolePunch

func HolePunch(portToStun, proto int) (publicIP net.IP, publicPort int, natType string)

HolePunch - performs udp hole punching on the given port

func LoadStunServers added in v0.30.0

func LoadStunServers(list string)

LoadStunServers - load customized stun servers

func SetDefaultStunServers added in v0.30.0

func SetDefaultStunServers()

Types

type StunServer

type StunServer struct {
	Domain string `json:"domain" yaml:"domain"`
	Port   int    `json:"port" yaml:"port"`
}

StunServer - struct to hold data required for using stun server

Jump to

Keyboard shortcuts

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