How to deploy a secure (`wss`) websocket server?

Hi, I am following this example to setup a websocket service,
This example shows how to handle a URI request like ws://....

However, in a https website, using ws protocal for websocket is considered as “unsecure”

Is there any example to setup a server that accepts wss URI?

1 Like

For posterity, I briefly answered on Slack.

If you’re doing this in a production type environment the easiest thing might be to put a reverse proxy that does SSL termination in front of the WebSocket server

So you’d have an NGINX process that has SSL termination setup and it would forward things to your WebSocket server which is listening on “vanilla” HTTP.