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

@mothepro/signaling-lobby

v0.3.3

Published

A simple lobby system which is used as a signaling server for peer-to-peer connections.

Downloads

5

Readme

Signaling Lobby

A simple lobby system which is used as a signaling server for peer-to-peer connections.

How to Use

Run the server npx @mothepro/signaling-lobby and use the following options to control it.

Flag | Alias | Type | Default | Description -----|-------|------|-------------|-------- version | | boolean | | Show the version number help | | boolean | | Show help verbose | v | count | None | Verbosity (-vvvvv is most verbose) hostname | h | string | localhost | The hostname to this server is running on port | p | number | A random free port | The port to host this server on max-length | | number | 15 | The max length of a client's name max-connections | | number | 65534 | The max number of connections the server supports. 65534 is the max supported idle-timeout | i | number | 20 minutes | The number of milliseconds a client can be connected to the server without joining a group sync-timeout | s | number | 30 seconds | The number of milliseconds a client will be connected to the server once syncing is complete key | | string | None | Path to the public key to use (Only for a secure server) cert | | string | None | Path to the certificate to use (Only for a secure server)

By tweaking the sync-timeout flag this server could be used for non-p2p signaling (longstanding groups that send data through the server)

EC2

Create a hosted zone to point to EC2 server public IP.

First, to support a secure server, create a key & cert pair with letsencrypt

Install with the following commands

sudo yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
sudo yum install certbot python2-certbot-apache
sudo yum -y install yum-utils
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

Make a security group that makes the port to use available.

Finally, Run the server and set the hostname (-h) to the private IP.

npx @mothepro/signaling-lobby -vvvvv \
-h ... \
-p 9000 \
--key /etc/letsencrypt/live/<DOMAIN>/privkey.pem \
--cert /etc/letsencrypt/live/<DOMAIN>/fullchain.pem

If access to the *.pem files is restricted the server be run in sudo mode. This can be enabled with the following command, because by default sudo npx doesn't work run, npx must be in the /usr/bin path.

sudo ln ~/.nvm/versions/node/<version>/bin/* -s /usr/bin

Install

The Socket Server is exposed as an NPM module so it can be imported to allow for customizations.

yarn add @mothepro/signaling-lobby

Roadmap

  • add DoS prevention (potenetially using 'headers' event)
  • Simplify / Remove redundant Group class
  • Improve system to determine who makes an offer
  • Export helpers for parsing buffers in util (Make BrowserSocket public)