npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

lib-testrtc

v1.6.0

Published

TestRTC turned into a library: Collection of tests and tools to help diagnose WebRTC systems.

Downloads

862

Readme

lib-testrtc

Turns TestRTC into a library to make tests embeddable in any page.

TestRTC

WebRTC troubleshooter provides a set of tests that can be easily run by a user to help diagnose WebRTC related issues. The user can then download a report containing all the gathered information or upload the log and create a temporary link with the report result.

Usage

Install with npm / yarn npm install lib-testrtc yarn add lib-testrtc

Or import the script into your page and use the global object TestRTC.

<script type="text/javascript" src="testrtc-min.js"></script>
<script type="text/javascript">
    const testRTC = new TestRTC({
      turnUsername: 'USERNAME',
      turnCredential: 'PASSWORD',
      turnURI: 'YOUR_TURN_URL',
      strunURI: 'YOUR_STUN_URI',
    });

    testRTC.start();
</script>

Callbacks

You can suscribe to different callbacks to get the tests reports:

// Test Progress
testRTC.onTestProgress((suiteName, testName, progress) => {});
// Global Progress
testRTC.onGlobalProgress((finishedCount, remainingCount) => {});
// Result
testRTC.onTestProgress((suiteName, testName, result) => {});
// Logs
testRTC.onTestReport((suite, test, level, message) => {});
// Tests completed
testRTC.onComplete(() => {});
// Tests stopped
testRTC.onStopped(() => {});

Suite control

The following commands are available:

testRTC.start() (Start from the beggining) testRTC.pause() testRTC.resume() testRTC.stop() (Stop the test suite)

testRTC.state gives an indication of the current state of the suite: stopped/started/paused.

Filtering tests

You can prevent the execution of a suites or a test case by passing it through a filter array in parameter:

const testRTC = new TestRTC(
  {
    turnUsername: 'USERNAME',
    turnCredential: 'PASSWORD',
    turnURI: 'YOUR_TURN_URL',
    strunURI: 'YOUR_STUN_URI'
  },
  (filter = [TestRTC.SUITES.CAMERA, TestRTC.TESTS.IPV6ENABLED])
);

The accepted values can be found here

Tests descriptions

  • Microphone
    • Audio capture
      • Checks the microphone is able to produce 2 seconds of non-silent audio
      • Computes peak level and maximum RMS
      • Clip detection
      • Mono mic detection
  • Camera
    • Check WxH resolution
      • Checks the camera is able to capture at the requested resolution for 5 seconds
      • Checks if the frames are frozen or muted/black
      • Detects how long to start encode frames
      • Reports encode time and average framerate
    • Check supported resolutions
      • Lists resolutions that appear to be supported
  • Network
    • Udp/Tcp
      • Verifies it can talk with a turn server with the given protocol
    • IPv6 connectivity
      • Verifies it can gather at least one IPv6 candidate
  • Connectivity
    • Relay
      • Verifies connections can be established between peers through a TURN server
    • Reflexive
      • Verifies connections can be established between peers through NAT
    • Host
      • Verifies connections can be established between peers with the same IP address
  • Throughput
    • Data throughput
      • Establishes a loopback call and tests data channels throughput on the link
    • Video bandwidth
      • Establishes a loopback call and tests video performance on the link
      • Measures rtt on media channels.
      • Measures bandwidth estimation performance (rampup time, max, average)
    • Network latency
      • Establishs a loopback call and sends very small packets (via data channels) during 5 minutes plotting them to the user. It can be used to identify issues on the network.

Build lib-testrtc

yarn && grunt build

Feel free to contribute by opening a pull request.