
Product
Introducing Scala and Kotlin Support in Socket
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
webrtc-data-channel-chunker
Advanced tools
This package helps sending media content over UDP via WebRTC. The functionality provided is limited to splitting up the media content on the transmitter end and glowing it on the receiver end.
This package helps sending media content over UDP via WebRTC. The functionality provided is limited to splitting up the media content on the transmitter end and glowing it on the receiver end.
The library aims to abstract the user from coercing its media content types to the underlying transport method, so it provides the most common types out of the box.
Uint8Array
ArrayBuffer
String
Blob
You can import as an NPM module, or extract the web-ready bundle from ./dist/web
.
// Tx
const chunks = await Chunker.getChunks('This is awesome 🔥', 11);
// Rx
const gluer = new Gluer();
for (const chunk of chunks) {
gluer.addChunk(chunk); // the order does not matter
}
console.log(await gluer.getContent());
// > 'This is awesome 🔥'
// Tx
const input = new ArrayBuffer(3);
const dataView = new DataView(input)
dataView.setUint8(1, 255);
const chunks = await Chunker.getChunks(input, 11);
// Rx
const gluer = new Gluer();
for (const chunk of chunks) {
gluer.addChunk(chunk); // the order does not matter
}
console.log(await gluer.getContent());
// > ArrayBuffer { [Uint8Contents]: <00 ff 00>, byteLength: 3 }
// Tx
const obj = {hello: 'world'};
const blob = new Blob([JSON.stringify(obj, null, 2)], {type : 'application/json'});
const chunks = await Chunker.getChunks(blob, 11);
// Rx
const gluer = new Gluer();
for (const chunk of chunks) {
gluer.addChunk(chunk); // the order does not matter
}
console.log(await (await gluer.getContent()).text());
// > "{\n \"hello\": \"world\"\n}"
The implementation of this library is based on this specification. Although with some differences:
Reliable/Ordered
mode. It will always use the Unreliable/Unordered
mechanism. The drawback is always having a 9-bytes header, but it works for all the possible cases.The Blob
support was not tested as it lacks of support in Node.JS. If you find any error please report.
FAQs
This package helps sending media content over UDP via WebRTC. The functionality provided is limited to splitting up the media content on the transmitter end and glowing it on the receiver end.
The npm package webrtc-data-channel-chunker receives a total of 0 weekly downloads. As such, webrtc-data-channel-chunker popularity was classified as not popular.
We found that webrtc-data-channel-chunker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket now supports Scala and Kotlin, bringing AI-powered threat detection to JVM projects with easy manifest generation and fast, accurate scans.
Application Security
/Security News
Socket CEO Feross Aboukhadijeh and a16z partner Joel de la Garza discuss vibe coding, AI-driven software development, and how the rise of LLMs, despite their risks, still points toward a more secure and innovative future.
Research
/Security News
Threat actors hijacked Toptal’s GitHub org, publishing npm packages with malicious payloads that steal tokens and attempt to wipe victim systems.