skip to navigation
skip to content

m2websocket 0.1.7

Makes websockets with Mongrel2 and Python super easy

Latest Version: 0.2.2

Makes handling websockets with Mongrel2 and Python easy.

This module was lovingly crafted for First Opinion.


Typical websocket hello world type example, creating an echo server:

from m2websocket import Connection

conn = Connection("tcp://localhost:port", "tcp://localhost:port")

while True:
    req = conn.recv()
    conn.reply_websocket(req, req.body, req.opcode)

Yup, that’s all there is to it, much easier than this example.

You can see a working example of the echo server (with a working mongrel2 conf file and python script) by looking in the example/ directory in the Github repo.

Install it


You’ll need to install the mongrel2 python library from the mongrel2 source. Once you’ve cloned the source or downloaded that folder, you can install it using

$ cd /path/to/mongrel2/src/examples/python
$ python install

Then, you can install this module using pip:

pip install m2websocket


pip install git+



File Type Py Version Uploaded on Size
m2websocket-0.1.7.tar.gz (md5) Source 2014-05-30 5KB