A high-performance, zero-allocation Go implementation of the RFC 5389 STUN protocol for NAT traversal.
STUN is a Go library that implements the Session Traversal Utilities for NAT (STUN) protocol, enabling applications to discover their public IP addresses and ports when behind network address translators (NATs). It solves the problem of NAT traversal, which is critical for establishing direct peer-to-peer connections in real-time communication systems like VoIP and WebRTC.
Go developers building real-time communication applications, VoIP systems, or any networked software requiring NAT traversal capabilities.
Developers choose this library for its high performance with zero allocations in hot paths, lack of external dependencies, and comprehensive RFC compliance. It's a mature, stable implementation that integrates seamlessly into Go-based networking stacks.
Fast RFC 5389 STUN implementation in go
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Benchmarks demonstrate no memory allocations in hot paths, optimizing for high-throughput and low-latency operations critical in real-time communication.
Client includes configurable retransmission timeouts (via WithRTO), enhancing reliability in unreliable network conditions without manual handling.
Self-contained implementation avoids third-party packages, simplifying dependency management and reducing potential conflicts in Go projects.
Supports RFCs 5389, 5769, 6062, and 7064 with TLS-over-TCP client functionality, ensuring interoperability with standard STUN servers.
Lacks support for ALTERNATE-SERVER and RFC 5780 (NAT behavior discovery), limiting functionality for failover and detailed NAT diagnostics.
The README states that additional STUN attributes are unlikely to be implemented, restricting customization for non-standard or future extensions.
Relies on a basic example and godoc references, offering little guidance for beginners or complex use cases beyond simple IP discovery.