go-test-nat

command module
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 2 Imported by: 0

README

go-test-nat

A Golang STUN client for getting NAT type and external IP refered to PyStun(https://github.com/jtriley/pystun)

Follow RFC 3489: http://www.ietf.org/rfc/rfc3489.txt

Use the Command Line

Clone this repo and run these

go build
./go-test-nat

Output will be like

2024/11/22 00:34:15 natType: Symmetric NAT
2024/11/22 00:34:15 externalIp: 223.110.71.25
2024/11/22 00:34:15 externalPort: 34256
Use the Library

github.com/dplcz/go-test-nat can be easily used like

import "github.com/dplcz/go-test-nat"

func main() {
    natType, externalIp, externalPort, err := stun.GetIpInfo()
	...
}
License

MIT License - see LICENSE for full text

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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