Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
@twilio/rtc-diagnostics
Advanced tools
Various diagnostics functions to help analyze connections to Twilio
The RTC Diagnostics SDK provides functions to test input and output devices (microphone, speaker, camera) as well as functionality to confirm that you meet the network bandwidth requirements required to make a voice call or join a video room.
This SDK requires the use of Twilio NTS or your own STUN/TURN servers to perform the network tests. Using Twilio NTS will mirror how Twilio uses STUN/TURN in Programmable Video when connecting to a Twilio Video Room and will incur charges as per NTS pricing.
# Clone repository
git clone git@github.com:twilio/rtc-diagnostics.git
cd rtc-diagnostics
# Install dependencies
npm install
# Build the artifacts under dist folder
npm run build
In order to run integration tests, you'll need to copy over the credentials.example.json
file
to credentials.json
in the same folder, and replace the empty fields with valid values.
You can install directly from npm.
npm install @twilio/rtc-diagnostics --save
Or install from a local directory.
npm install /local-path-to-repo/rtc-diagnostics
Using this method, you can import rtc-diagnostics
like so:
import { testMediaConnectionBitrate } from '@twilio/rtc-diagnostics';
You can also include rtc-diagnostics.js
directly in your web app using a <script>
tag.
<script src="https://my-server-path/rtc-diagnostics.js"></script>
Using this method, rtc-diagnostics.js
will set a browser global:
const { testMediaConnectionBitrate } = Twilio.Diagnostics;
The following are examples for running tests. For more information, please refer to the API Docs
import { testMediaConnectionBitrate } from '@twilio/rtc-diagnostics';
const mediaConnectionBitrateTest = testMediaConnectionBitrate({
iceServers: [{
credential: 'bar',
username: 'foo',
urls: 'turn:global.turn.twilio.com:3478?transport=udp',
}],
});
mediaConnectionBitrateTest.on('bitrate', (bitrate) => {
console.log(bitrate);
});
mediaConnectionBitrateTest.on('error', (error) => {
console.log(error);
});
mediaConnectionBitrateTest.on('end', (report) => {
console.log(report);
});
setTimeout(() => {
mediaConnectionBitrateTest.stop();
}, 10000);
See MediaConnectionBitrateTest.Options
for more information for how to obtain the urls values
import { testAudioInputDevice, AudioInputTest } from '@twilio/rtc-diagnostics';
const audioInputDeviceTest = testAudioInputDevice({
deviceId: ...,
});
audioInputDeviceTest.on(AudioInputTest.Events.Volume, (volume) => {
console.log(volume);
});
audioInputDeviceTest.on(AudioInputTest.Events.Error, (error) => {
console.error(error);
});
audioInputDeviceTest.on(AudioInputTest.Events.End, (report) => {
console.log(report);
});
setTimeout(() => {
audioInputDeviceTest.stop();
}, 10000);
import { testVideoInputDevice, VideoInputTest } from '@twilio/rtc-diagnostics';
const videoInputDeviceTest = testVideoInputDevice({ element: videoElement });
videoInputDeviceTest.on(VideoInputTest.Events.Error, (error) => {
console.error(error);
});
videoInputDeviceTest.on(VideoInputTest.Events.End, (report) => {
console.log(report);
});
setTimeout(() => {
videoInputDeviceTest.stop();
}, 10000);
import { testAudioOutputDevice, AudioOutputTest } from '@twilio/rtc-diagnostics';
const audioOutputDeviceTest = testAudioOutputDevice({
deviceId: ...,
});
audioOutputDeviceTest.on(AudioOutputTest.Events.Volume, (volume) => {
console.log(volume);
});
audioOutputDeviceTest.on(AudioOutputTest.Events.Error, (error) => {
console.error(error);
});
audioOutputDeviceTest.on(AudioOutputTest.Events.End, (report) => {
console.log(report);
});
setTimeout(() => {
audioOutputDeviceTest.stop();
}, 10000);
See LICENSE.md
FAQs
Various diagnostics functions to help analyze connections to Twilio
The npm package @twilio/rtc-diagnostics receives a total of 2,692 weekly downloads. As such, @twilio/rtc-diagnostics popularity was classified as popular.
We found that @twilio/rtc-diagnostics 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.