Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

webrtc-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webrtc-polyfill

High performance WebRTC polyfill for Node.JS via libdatachannel using Node Native/NAPI.

  • 1.1.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.5K
increased by0.9%
Maintainers
1
Weekly downloads
 
Created
Source

    

webrtc-polyfill is a Node.js Native Addon that provides bindings to libdatachannel. This project aims for spec-compliance and is tested using the W3C's web-platform-tests project, but doesn't pass all of its tests, instead focuses on the important ones, like close, error and data events, states, while offering performance better than any alternative. A number of nonstandard APIs for testing are also included.

Notably most of the core WebRTC functionality is async in contrast to how web handles it. Notable examples are:

datachannel.send(new Blob([new Uint8Array([1,2,3,4])]))
datachannel.send(new Uint8Array([1,2,3,4])) // this will arrive before the blob, as blob internals are asynchronous

and

datachannel.send(new Uint8Array([1,2,3,4]))
datachannel.bufferedAmount // not always 4, as the thread that runs it is async and might flush instantly!

Install

pnpm install webrtc-polyfill

Supported Platforms

For supported platforms see the node-channel bindings compatibility table. Note that node versions under 14 require a global EventTarget and Event polyfill.

Testing

Requirements: Python, Node.js

Keywords

FAQs

Package last updated on 22 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc