
Security News
Another Round of TEA Protocol Spam Floods npm, But It’s Not a Worm
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.
Basic RTCPeerConnection statistics. See the live demo.
npm install get-stats
The exposed constructor takes a RTCPeerConnection instance as first argument and an optional array of media tracks as second argument. If a track array is not provided, statistics for all available tracks, from both local and remote media streams, are accumulated into a single report.
The constructor returns a function which must be called with a callback to get the report.
var pc = new RTCPeerConnection();
var getStats = require('get-stats')(pc);
getStats(function(err, report) {
if(err) throw err;
console.log(report);
});
The generated report will look something like the following.
{
bytesSent: 358741,
packetsSent: 440,
bytesReceived: 421513,
packetsReceived: 852,
packetsLost: 0,
timestamp: Date(),
rtt: 4, // round trip time
bytesSentSpeed: 45386, // upload speed in bytes/second
bytesReceivedSpeed: 53166.6, // download speed in bytes/second
packetsLostSpeed: 0 // average packet lost over the measured period
}
For example to get only the upload statistics for a connection, the local media streams can be passed to the getStats function.
var getStats = require('get-stats')(pc, pc.getLocalStreams());
getStats(function(err, report) {
if(err) throw err;
console.log('upload speed', report.bytesSentSpeed);
});
// Get report for only the video track
var videoTrack = pc.getLocalStreams()[0].getVideoTracks()[0];
var getStats = require('get-stats')(pc, videoTrack);
getStats(function(err, report) {
if(err) throw err;
console.log('upload speed', report.bytesSentSpeed);
});
Same way download statistics can be calculated using RTCPeerConnection.getRemoteStreams.
FAQs
Basic RTCPeerConnection statistics
The npm package get-stats receives a total of 1 weekly downloads. As such, get-stats popularity was classified as not popular.
We found that get-stats 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
Recent coverage mislabels the latest TEA protocol spam as a worm. Here’s what’s actually happening.

Security News
PyPI adds Trusted Publishing support for GitLab Self-Managed as adoption reaches 25% of uploads

Research
/Security News
A malicious Chrome extension posing as an Ethereum wallet steals seed phrases by encoding them into Sui transactions, enabling full wallet takeover.