Skip to main content

Makes websockets with Mongrel2 and Python super easy

Project description

Makes handling websockets with Mongrel2 and Python easy.

This module was built for First Opinion.

Example

Typical websocket hello world example, creating an echo server:

from m2websocket import Connection

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

while True:
    req = conn.recv_frame()
    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

Use Pip:

pip install m2websocket

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

m2websocket-0.1.tar.gz (5.1 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page