I struggled for a while to get a working example with erlang and secure websockets. A lot had to do with not understanding the recommended erlang build chain. Here's a working example of WSS.
- git clone https://github.com/DanThiffault/cowboy-wss-example
openssl req -x509 -newkey rsa:2048 -keyout priv/ssl/key.pem -out priv/ssl/cert.pem -days 365 -nodes
- make all
- make rel
- ./_rel/bin/websocket_example start
- visit http://localhost:8080 or https://localhost:8443
If you're using https, make sure to change the connection to wss://localhost:8443
tail -F _rel/log/*