wrtc provides a standards-compliant WebRTC implementation for Node.js, currently binding to WebRTC M81 (as of v0.4.7). This library leverages N-API (since v0.4.0) to ensure ABI stability across various Node.js releases, significantly enhancing compatibility and reducing issues often associated with native addons and Node.js version updates. The project prioritizes spec-compliance, validating its API behavior against the W3C's web-platform-tests project, making it a reliable choice for server-side WebRTC applications. Releases generally align with new WebRTC M-milestones and Node.js version support, indicating an active and well-maintained project cadence. It differentiates itself by offering a direct, low-level WebRTC API within the Node.js runtime, enabling scenarios like media processing, signaling servers, and peer-to-peer connections outside of a browser environment, and also includes nonstandard APIs for testing purposes. The current stable version is 0.4.7, continuously updated for Node.js compatibility and WebRTC feature parity.
npm install wrtcVerified import paths — ran on the pinned version, not inferred.
Demonstrates setting up two RTCPeerConnections locally in Node.js, exchanging SDP offer/answer, ICE candidates, and establishing a basic RTCDataChannel for message exchange.
Remove `dtx`, `ptime`, and `codecPayloadType` from `RTCRtpEncodingParameters` objects. Consult the latest WebRTC 1.0 specification for current valid parameters.
Ensure your Node.js and Electron versions are within the supported ranges listed in the documentation. For ARM architectures (e.g., Raspberry Pi), set `TARGET_ARCH` to 'arm' or 'arm64' before running `npm install wrtc`. If issues persist, refer to the 'build from source' guide.
Upgrade your Node.js environment to a supported version (e.g., Node.js ^8.11.2 || >=10.0.0, up to 14 as of 0.4.7) or use an older version of the `wrtc` package compatible with your environment.
Ensure you are using `wrtc` version 0.4.1 or newer to benefit from memory leak fixes related to `RTCDataChannel` string reception. Always test high-volume scenarios carefully.
Run `npm install wrtc` in your project directory. Verify your `NODE_PATH` environment variable if you're using a non-standard module resolution setup.
Check the `wrtc` documentation for supported platforms and Node.js versions. If using an ARM device, ensure you set `TARGET_ARCH=arm` or `TARGET_ARCH=arm64` before `npm install wrtc`. If a prebuilt binary isn't available, you may need to compile `wrtc` from source (`npm install wrtc --build-from-source`).
Ensure you are importing `RTCPeerConnection` correctly: `import { RTCPeerConnection } from 'wrtc';` for ESM, or `const { RTCPeerConnection } = require('wrtc');` for CommonJS. If you imported the whole module as an object, access it like `new wrtc.RTCPeerConnection()`.No dependency data recorded yet.