Skip to content

epochtalk/ept-websocket-server

Repository files navigation

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •