@agentdance/node-webrtc-stun
v1.0.4
Published
RFC 5389 STUN message codec + client — HMAC-SHA1 integrity, CRC-32 fingerprint, ICE attributes. Part of the @agentdance/node-webrtc stack.
Downloads
538
Maintainers
Readme
@agentdance/node-webrtc-stun
RFC 5389 STUN message codec + client for Node.js — part of the @agentdance/node-webrtc pure-TypeScript WebRTC stack.
Features
- Full message encode/decode: XOR-MAPPED-ADDRESS (IPv4 + IPv6), MAPPED-ADDRESS, USERNAME, ERROR-CODE
- HMAC-SHA1 MESSAGE-INTEGRITY; CRC-32 FINGERPRINT
- ICE attributes: PRIORITY, USE-CANDIDATE, ICE-CONTROLLING, ICE-CONTROLLED
- Transaction client with retransmit
- Zero native dependencies
Install
npm install @agentdance/node-webrtc-stunUsage
import { encodeMessage, decodeMessage, createBindingRequest } from '@agentdance/node-webrtc-stun';
const req = createBindingRequest({ username: 'user:pass', priority: 12345 });
const buf = encodeMessage(req, 'password');
const msg = decodeMessage(buf);Full Documentation
See the main package README for the complete API reference, usage examples, and architecture overview.
License
MIT
