tongwu226 / livelab-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The Signalling Server for LiveLab

This repo guides you to set up your own signalling server if you want to clone and modify the open-sourced project LiveLab by CultureHub at https://github.com/CultureHub/LiveLab

For more up-to-dated content about self-hosting Livelab server, please check here at https://github.com/CultureHub/LiveLab_server

ChangeLog

[05.18.2020] Running Locally

To test and modify this web server locally, you need to download the repo, and operate as following:

Update the content and filename for the .env-samplefile

The file .env-samplerequires you to fill in your

  • TWILIO_SID = Twilio Account SID
  • TWILIO_AUTH = Twilio Auth Token
  • PORT = a local port as your wish (0 ~ 65535) to run the signaling server

Then you should change the filename from .env-sample to .env

Generate locally-trusted SSL certificates

Secure your local signaling server with locally-trusted SSL certificates by using mkcert.

mkcert is a simple tool for making locally-trusted development certificates. It requires no configuration.)

After installing mkcert, create a new local CA at the local server directory:

$ mkcert -install

Request the local CA at your localhost:

$ mkcert localhost

Running the commands above generates two certificate files, localhost.pem and localhost-key.pem.

Move the two files to be under the certs folder and deleted the placeholder files localhost-key.txt and localhost.txt

Warning: the two .pem files give complete power to intercept secure requests from your machine. Do not share them.

Then, to run the signaling server locally:

*if you have specified a port number in .env file

npm start

*use the command line to specify a port number (e.g: 1000)

PORT=1000 npm start

Now you can access your local server at https://localhost:{port you've selected} e.g. https://localhost:1000

About


Languages

Language:JavaScript 93.2%Language:HTML 6.8%