Looking for demo about secure websockets

I’m trying it create a websocket on server, using GitHub - vbmithr/ocaml-websocket: Websocket library for OCaml and ws-server/lib at master · roddyyaga/ws-server · GitHub. Default websockets work OKay, but I have troubles to find a demo about secure websockets (i.e. links like “wss://…”).

In my project I use Lwt, and I’m looking for Lwt-based solution. But if using async will be required, OKay, I will rewrite.

I found something that mentions “wss” and “https”, but there are some issues with compilation of the code in the repo (ubound module Time_ns_unix), so I decided to check community first.

In almost all cases you will want to use a reverse proxy like Nginx or Caddy to do TLS termination, including for https:// and wss:// protocols. Caddy can even set up a Let’s Encrypt cert for you automatically (and even update it periodically) provided it’s reachable from the internet, using ACME. Nginx with manual TLS cert setup shouldn’t be that much more difficult.

Long story short, use a reverse proxy :slight_smile:

1 Like