Skip to main content

Node HTTP

Node is the default HTTP server as it supports all platforms and is much easier to debug.

To enable SSL, all you need to do is pass in the the loaded file and cert.

You can either do this using an explicit path:

ssl:
key: fileLoad(/location/to/ssl/key.pem)
cert: fileLoad(/location/to/ssl/key.pem)

or relative to the config file (less likely on a production install):

ssl:
key: fileLoad(ssl/key.pem)
cert: fileLoad(ssl/key.pem)

How to configure:

httpServer:
type: default
options:
# url path for http health-checks, GET requests to this path will return 200 if deepstream is alive
healthCheckPath: /health-check
# -- CORS --
# if disabled, only requests with an 'Origin' header matching one specified under 'origins'
# below will be permitted and the 'Access-Control-Allow-Credentials' response header will be
# enabled
allowAllOrigins: true
# a list of allowed origins
origins:
- 'https://example.com'
# maximum allowed size of a POST request body, in bytes, defaults to 1 MB
maxMessageSize: 1048576
# Headers to copy over from websocket
headers:
- user-agent
ssl:
key: fileLoad(/path/to/sslKey)
cert: fileLoad(/path/to/sslCert)
ca: fileLoad(/path/to/caAuth)