Socket server for epochtalk notifications.
cp example.env .env
WEBSOCKET_HOST # specify the host to listen on
WEBSOCKET_PORT # specify the port to expose
WEBSOCKET_API_KEY # used to validate the Epochtalk server
PRIVATE_KEY # to reflect that of the Epochtalk server.
# used for JWT token authentication.
DATABASE_URL # the URL for the postgres instance
Websocket-server uses Redis to keep track of users who are currently online. To
set up a connection to Redis, provide the following variables in .env
.
REDIS_HOST # the redis host to connect to
REDIS_PORT # the redis port to connect to
REDIS_DB # the number of the redis db
If you would like to use SSL, enable it by setting WEBSOCKET_PROTOCOL=https
.
You will also need to provide:
-
A key at
keys/WEBSOCKET_KEY_NAME
-
A cert at
keys/WEBSOCKET_CERT_NAME
You may provide an optional WEBSOCKET_KEY_NAME
and WEBSOCKET_CERT_NAME
.
If you do not provide them, defaults are:
-
WEBSOCKET_KEY_NAME=server.key
-
WEBSOCKET_CERT_NAME=server.crt
Full options:
WEBSOCKET_PROTOCOL # http or https
WEBSOCKET_KEY_NAME # corresponds to the file name of the key
WEBSOCKET_CERT_NAME # corresponds to the file name of the cert
WEBSOCKET_PASS # the passphrase for the ssl private key
You can specify uws as the engine
WEBSOCKET_ENGINE # ws (default) or uws
npm install
npm run serve