Metadata-Version: 2.4
Name: bottle-websocket
Version: 0.2.9
Summary: WebSockets for bottle
Home-page: https://github.com/zeekay/bottle-websocket
Author: Zach Kelling
Author-email: zk@monoid.io
License: MIT
Keywords: bottle websockets
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
License-File: LICENSE
Requires-Dist: bottle
Requires-Dist: gevent-websocket
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: license-file
Dynamic: requires-dist
Dynamic: summary

This project adds websocket capabilities to [bottle](http://bottlepy.org), leveraging [gevent-websocket](http://www.gelens.org/code/gevent-websocket/) and [gevent](http://www.gevent.org/).

### Install
Use `pip` or `easy_install`:

    pip install bottle-websocket

### Usage
Usage is pretty straight-forward, just import the server and plugin:

    from bottle.ext.websocket import GeventWebSocketServer
    from bottle.ext.websocket import websocket

You can use the websocket plugin to turn routes websocket handlers, the websocket is passed to the route as the first argument:

    @get('/websocket', apply=[websocket])
    def echo(ws):
        while True:
            msg = ws.receive()
            if msg is not None:
                ws.send(msg)
            else: break

And then use the provided server:

    run(host='127.0.0.1', port=8080, server=GeventWebSocketServer)

### Contributors
- [zeekay](https://github.com/zeekay)
- [xeross](https://github.com/xeross)
