
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
minijanus-ts
Advanced tools
A small Javascript wrapper for talking to the Janus WebRTC signaling API. Forked from minijanus.js to add TS support and additional functionality.
Forked from Minijanus.js. This is rebuilt with TypeScript first, moves to Yarn and Jest from NPM and Tape, and is adding support for plugins as needed. Currently, it adds the videoroom plugin. I would like to improve the documentation further as I've added a few more features, but haven't gotten around to it yet. This is still early and being worked through as I have use cases for it.
npm install minijanus-ts
yarn add minijanus-ts
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, but fundamentally plugin-agnostic. Designed to
provide useful possible abstractions while still providing the maximum possible control over RTCPeerConnection
configuration and precise plugin signalling flow.
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:
RTCPeerConnection
directly, whereas janus.js
wraps and manages the connection for you.If you want a similar but moderately more featureful wrapper, check out minnie-janus.
Require minijanus-ts
. It should work with ES6 (or greater) or CommonJS syntax.
var ws = new WebSocket("ws://localhost:8188", "janus-protocol");
var session = new JanusSession(ws.send.bind(ws));
var handle = new JanusPluginHandle(session);
var conn = new RTCPeerConnection({});
ws.addEventListener("message", ev => session.receive(JSON.parse(ev.data)));
ws.addEventListener("open", _ => {
session.create()
.then(_ => handle.attach("janus.plugin.sfu"))
.then(_ => {
conn.addEventListener("icecandidate", ev => {
handle.sendTrickle(ev.candidate || null).catch(e => console.error("Error trickling ICE: ", e));
});
conn.addEventListener("negotiationneeded", _ => {
var offer = conn.createOffer();
var local = offer.then(o => conn.setLocalDescription(o));
var remote = offer.then(j => handle.sendJsep(j)).then(r => conn.setRemoteDescription(r.jsep));
Promise.all([local, remote]).catch(e => console.error("Error negotiating offer: ", e));
});
var unreliableCh = conn.createDataChannel("unreliable", { ordered: false, maxRetransmits: 0 });
var reliableCh = conn.createDataChannel("reliable", { ordered: true });
navigator.mediaDevices.getUserMedia({ audio: true })
.then(m => m.getTracks().forEach(t => conn.addTrack(t, m)))
.catch(e => console.error("Error acquiring media: ", e));
return new Promise(resolve => handle.on("webrtcup", resolve));
})
.then(_ => { console.info("Connected to Janus: ", conn); })
.catch(e => { console.error("Error connecting to Janus: ", e); });
});
(Note that this example code first negotiates only the data channels, and then renegotiates afterward when the microphone permission is provided. Only recent versions of Janus support renegotiation. If you didn't want this, you would instead wait to create the connection until the microphone permission was granted.)
$ yarn build
$ yarn test
FAQs
A small Javascript wrapper for talking to the Janus WebRTC signaling API. Forked from minijanus.js to add TS support and additional functionality.
The npm package minijanus-ts receives a total of 1 weekly downloads. As such, minijanus-ts popularity was classified as not popular.
We found that minijanus-ts 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.