This is a simple wrapper around the mochiweb_socket_server to allow WebSocket connections. With this wrapper, you can write WebSocket connection loops just like you’d write a normal mochiweb application.
This repo is forked from the Dave Bryson’s one, but I’m working on allowing two-way communication with the client, with one process listening for data from the client, and another one sending data back, so you can send him messages without waiting for him to act.
The chat server example is actually work in progress (and can be broken anytime), it will be released in a week or so, after a huge refactoring.
- Erlang 12.5 or greater
- Google Chrome Browser developer channel release 188.8.131.52
- download the code
- CD into the erlang_websocket directory
- run make
Run the cate example:
- CD into the examples/basic directory
- run the ‘start.sh’ script with sudo (the flash policy server needs to bind top port 843).
- Point the Chrome Browser (or any other if you want to try the Flash fallback) to ‘http://localhost:8000’