A Go implementation of the STUN client for UDP hole punching and NAT traversal (RFC 3489 and 5389).
go-stun is a Go implementation of the STUN (Session Traversal Utilities for NAT) client protocol. It helps applications discover their public IP address and NAT type, which is essential for establishing peer-to-peer connections through network address translators. The project provides both a library for integration into Go applications and a command-line tool for network diagnostics.
Go developers building peer-to-peer applications, VoIP systems, or any networked software that needs to traverse NATs and firewalls. Network engineers and administrators who need to diagnose NAT configurations.
Developers choose go-stun for its clean, minimal implementation of the STUN protocol that's easy to integrate, its compliance with both RFC 3489 and 5389 standards, and the convenience of having both a library and CLI tool in one package.
A go implementation of the STUN client (RFC 3489 and RFC 5389)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
With a single function call `stun.NewClient().Discover()`, developers can retrieve NAT type and external IP, making integration straightforward for basic discovery needs.
Supports both RFC 3489 and RFC 5389, ensuring compatibility with a wide range of STUN servers and protocols.
Includes a command-line interface with verbose mode and custom server options, allowing quick network diagnostics without writing code.
Prioritizes simplicity and minimalism, resulting in a lightweight library with no unnecessary dependencies, easy to audit and maintain.
Does not implement TURN or ICE protocols, which are often required for complete NAT traversal in production peer-to-peer applications, especially with symmetric NATs.
Only allows specifying a custom STUN server via a flag; lacks advanced settings for timeouts, retries, or multiple server fallbacks, as noted in the minimal documentation.
Exclusively for Go projects, so it's not suitable for cross-language or multi-platform development without additional bridging efforts.