
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
A super-simplistic and -minimal wrapper for talking to the Janus signalling API. Developed for use with Janus as a web game networking backend via janus-plugin-sfu.
If you want a batteries-included wrapper, you should use the one distributed by the Janus developers -- janus.js. This one is different in a few ways:
Require minijanus
in Node, or link to bundle.js in a browser. Then:
var ws = new WebSocket("ws://localhost:8188", "janus-protocol");
ws.addEventListener("open", () => {
var session = new Minijanus.JanusSession(ws.send.bind(ws));
ws.addEventListener("message", ev => session.receive(JSON.parse(ev.data)));
session.create().then(() => establishConnection(session)).then(() => {
console.info("Connection established: ", handle);
});
});
function negotiateIce(conn, handle) {
return new Promise((resolve, reject) => {
conn.addEventListener("icecandidate", ev => {
handle.sendTrickle(ev.candidate || null).then(() => {
if (!ev.candidate) { // this was the last candidate on our end and now they received it
resolve();
}
});
});
});
};
function establishConnection(session) {
var conn = new RTCPeerConnection({});
var handle = new Minijanus.JanusPluginHandle(session);
return handle.attach("janus.plugin.sfu").then(() => {
var iceReady = negotiateIce(conn, handle);
var unreliableCh = conn.createDataChannel("unreliable", { ordered: false, maxRetransmits: 0 });
var reliableCh = conn.createDataChannel("reliable", { ordered: true });
var mediaReady = navigator.mediaDevices.getUserMedia({ audio: true });
var offerReady = mediaReady
.then(media => {
conn.addStream(media);
return conn.createOffer({ audio: true });
}, () => conn.createOffer());
var localReady = offerReady.then(conn.setLocalDescription.bind(conn));
var remoteReady = offerReady
.then(handle.sendJsep.bind(handle))
.then(answer => conn.setRemoteDescription(answer.jsep));
return Promise.all([iceReady, localReady, remoteReady]);
});
}
To generate bundle.js:
$ npm run build
$ npm run test
FAQs
A small Javascript wrapper for talking to the Janus WebRTC signalling API.
The npm package minijanus receives a total of 2 weekly downloads. As such, minijanus popularity was classified as not popular.
We found that minijanus 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.
Security News
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.