Simple web chat app using EventStream.

There is a public instance available here:

There are iOS and Android demo clients.


Install dependencies, setup database, and create empty environment config:

virtualenv --python=python3 venv
. venv/bin/activate
pip install -r requirements.txt
python migrate
touch .env

Note: The django_eventstream library doesn't get installed and instead is loaded from within this repository by relative path.


python runserver

Open browser to http://localhost:8000/

Running with Fanout Cloud

Set GRIP_URL in your .env:


Be sure to replace {realm-id} and {realm-key} with the values from the Fanout control panel.

In a separate shell, run ngrok for local tunneling:

ngrok http 8000

Run a local instance of the project:

python runserver_ngrok

The runserver_ngrok command automatically sets the ngrok tunnel as your Fanout Cloud domain's Origin Server.

Open browser to your Fanout Cloud domain (e.g. https://{realm-id} Requests made to Fanout Cloud should be routed through ngrok to the local instance.

Running with Pushpin

Set GRIP_URL in your .env:


Run Pushpin:

pushpin --route="* localhost:8000"

Run the server:

python runserver

Open browser to http://localhost:7999/


Get past messages:

GET /rooms/{room-id}/messages/

Params: (None)

Returns: JSON object, with fields:

  • messages: list of the most recent messages, in time descending order
  • last-event-id: last event ID (use this when listening for events)

Send message:

POST /rooms/{room-id}/messages/


  • from={string}: the name of the user sending the message
  • text={string}: the content of the message

Returns: JSON object of message

Get events:

GET /events/


  • channel: events channel to listen to, using the form room-{room-id}. can be specified more than once to listen to events of multiple rooms
  • lastEventId: event ID to start reading from (optional)

Returns: SSE stream