15 Commits

Author SHA1 Message Date
80eb39b5b8 Add test for memory and redis store 2020-03-14 08:36:21 +01:00
d6104bae14 Make redis configurable 2020-03-13 22:56:11 +01:00
41705177c5 Add redis store
Tested locally with docker-compose and two instances of peer-calls
running on different ports.
2020-03-13 21:41:03 +01:00
27d2459e1d Make socket.ts asynchronous
Also do not monkey-patch socket objects with user ids.
2020-03-13 20:28:46 +01:00
cd4979c3be Generate userIDs on server-side
We don't want to depend on:

1) socket.io generated IDs because they change on server reconnect
2) simple-peer generated IDs because they change for every peer
connection

We generate a single ID when the call web page is refreshed and use that
throughout the session (until page refresh).

We keep relations of user-id to socket-id on the server side in memory
and use that to get to the right socket. In the future this might be
replaced with Redis to allow multiple nodes.

If the server is restarted, but people have active calls, we want them
to keep using the active peer connections and only connect to new peers.

Ideally, we do not want to disturb the active peer connections, but peer
connections might be restarted because the in-memory store will not have
the information on for any peers in the room upon restart.
2020-03-13 13:33:54 +01:00
8ebd92c53d Add input field to specify call name 2020-03-11 14:24:36 +01:00
a828b1570d Replace doT with ejs
doT had a security vulnerability and ejs has even fewer dependencies:

https://www.npmjs.com/advisories/798
2019-11-19 23:41:34 -03:00
3ae120b3ba Add ability to log requests 2019-11-19 12:48:23 -03:00
2d14e5fd33 Replace pug with doT
Pug contains a lot of unnecessary dependencies leading to code bloat,
which results in increased docker package size, and thus docker image
size). express-dot-engine is much simpler and performs better.
2019-11-19 12:21:19 -03:00
e1b7283a94 Remove handling of SIGTERM
New version of socket.io cannot terminate cleanly when there are active
connections:

https://github.com/socketio/socket.io/issues/1602
2019-11-18 22:40:07 -03:00
23fabb0b0c Do not always require custom configuration files 2019-11-18 13:01:01 -03:00
976bd5642c Fix failing test 2019-11-16 09:18:42 -03:00
92a5f2063c Use SignalData on server-side
This should not cause compile issues when simple-peer is not installed
(because client-side JS will be precompiled after pkg is published in
NPM repository) because types are not used in runtime.
2019-11-16 00:06:41 -03:00
17bea91c1d Move src/{views,res} to root
To make it available after ts server files are compiled into lib folder
2019-11-13 22:27:34 -03:00
1eaca46a16 Install typescript, upgrade server to TypeScript 2019-11-13 00:54:35 -03:00