WebSocket implementation in Erlang/Mochiweb, with a chat app.
Erlang JavaScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 24 commits ahead, 6 commits behind davebryson:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Erlang WebSocket wrapper for MochiWeb

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.


  1. Erlang 12.5 or greater
  2. Google Chrome Browser developer channel release

Getting Started:

  1. download the code
  2. CD into the erlang_websocket directory
  3. run make

Run the cate example:

  1. CD into the examples/basic directory
  2. run the ‘start.sh’ script with sudo (the flash policy server needs to bind top port 843).
  3. Point the Chrome Browser (or any other if you want to try the Flash fallback) to ‘http://localhost:8000’