stun

package
v0.0.0-...-293afec Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

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 IsPublicIP

func IsPublicIP(ip net.IP) bool

IsPublicIP indicates whether IP is public or not.

func LoadStunServers

func LoadStunServers(list string)

LoadStunServers - load customized stun servers

func SetDefaultStunServers

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