latency

package
v0.3.7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Stun nat behavior test

modified from https://github.com/pion/stun/blob/master/cmd/stun-nat-behaviour/main.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DNS

func DNS(p netapi.Proxy, host, target string) (time.Duration, error)

func DNSOverQuic

func DNSOverQuic(p netapi.Proxy, host, target string) (time.Duration, error)

func HTTP

func HTTP(p netapi.Proxy, target string) (time.Duration, error)

func Mapping added in v0.3.7

func Mapping(conn net.PacketConn, udpAddr netapi.Address, timeout time.Duration) (Response, NatType, error)

func StunTCP added in v0.3.7

func StunTCP(ctx context.Context, p netapi.Proxy, host string) (string, error)

func TCPConnectLatency

func TCPConnectLatency(address, portstr string) (time.Duration, error)

TCPDelay get once delay by tcp

Types

type NatType added in v0.3.7

type NatType int32
const (
	Unknown NatType = iota
	NoResult
	EndpointIndependentNoNAT
	EndpointIndependent
	AddressDependent
	AddressAndPortDependent
	ServerNotSupportChangePort
)

func Filtering added in v0.3.7

func Filtering(conn net.PacketConn, udpAddr netapi.Address, timeout time.Duration) (NatType, error)

func (NatType) String added in v0.3.7

func (n NatType) String() string

type Response added in v0.3.7

type Response struct {
	FromAddr net.Addr
	// contains filtered or unexported fields
}

func ParseResponse added in v0.3.7

func ParseResponse(msg *stun.Message) (Response, error)

type StunResponse added in v0.3.7

type StunResponse struct {
	MappedAddr    string
	MappingType   NatType
	FilteringType NatType
}

func Stun added in v0.3.7

func Stun(ctx context.Context, p netapi.Proxy, host string) (StunResponse, error)

Jump to

Keyboard shortcuts

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