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

Hi, I am following this example to setup a websocket service,
https://github.com/JuliaWeb/WebSockets.jl/blob/master/examples/minimal_server.jl
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”
https://stackoverflow.com/questions/26791107/wss-on-http-vs-wss-on-https

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

2 Likes

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.

3 Likes