stun

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: Apache-2.0 Imports: 8 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: "stun1.netmaker.io", Port: 3478},
		{Domain: "stun2.netmaker.io", Port: 3478},
	}
)

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 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.

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