0.3.3 • Published 5 years ago

@mothepro/signaling-lobby v0.3.3

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
5 years ago

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.

FlagAliasTypeDefaultDescription
versionbooleanShow the version number
helpbooleanShow help
verbosevcountNoneVerbosity (-vvvvv is most verbose)
hostnamehstringlocalhostThe hostname to this server is running on
portpnumberA random free portThe port to host this server on
max-lengthnumber15The max length of a client's name
max-connectionsnumber65534The max number of connections the server supports. 65534 is the max supported
idle-timeoutinumber20 minutesThe number of milliseconds a client can be connected to the server without joining a group
sync-timeoutsnumber30 secondsThe number of milliseconds a client will be connected to the server once syncing is complete
keystringNonePath to the public key to use (Only for a secure server)
certstringNonePath 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)
0.3.2

5 years ago

0.3.1

5 years ago

0.3.3

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago