TURN / STUN stack
MF TURN
A TURN/STUN stack written in Go for MF Core, with no dependency on it. It ships embedded in the MF Core homeserver; this page describes the stack itself.
Go, no cgoUDP · TCP · TLSEmbedded in MF Core
Protocol scope
STUN messages, attributes, integrityRFC 5389, RFC 8489
TURN allocations, permissions, channelsRFC 5766, RFC 8656
TCP allocationsRFC 6062
Relaying to IPv6RFC 6156
TransportsUDP, TCP, TLS
Out of scope: ICE (RFC 8445), SFU and any media-processing role. TURN over DTLS (RFC 7350) is a later phase behind the transport interface.
Design rules
- The module does not import its callers; configuration, logging and metrics arrive through interfaces.
- Transports sit behind one interface. The core is pure Go, no cgo, and links into a single binary.
- Failure accounting is a protocol requirement: every error response carries the applicable RFC code, a non-empty reason phrase and a
SOFTWAREattribute; cases that must stay silent surface through diagnostics instead. - Packets arrive from unauthenticated senders — parsers are fuzzed and responses are checked against amplification.