Skip to content

Latest commit

 

History

History
82 lines (55 loc) · 1.63 KB

README.md

File metadata and controls

82 lines (55 loc) · 1.63 KB

Epochtalk Websocket Server

Socket server for epochtalk notifications.

Configuration

cp example.env .env

EpochTalk

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.

Postgres

DATABASE_URL # the URL for the postgres instance

Redis

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

SSL

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

Engine

You can specify uws as the engine

WEBSOCKET_ENGINE # ws (default) or uws

Running

npm install

npm run serve