bottle-websocketWebSockets for bottle | |
Download |
bottle-websocket Ranking & Summary
Advertisement
- License:
- Other/Proprietary Li...
- Price:
- FREE
- Publisher Name:
- Zach Kelling
- Publisher web site:
- https://github.com/zeekay/
bottle-websocket Tags
bottle-websocket Description
bottle-websocket adds websocket capabilities to bottle, leveraging gevent-websocket and gevent.Usage is pretty straight-forward, just import the server and plugin: from bottle.ext.websocket import GeventWebSocketServer from bottle.ext.websocket import websocketYou can use the websocket plugin to turn routes websocket handlers, the websocket is passed to the route as the first argument: @get('/websocket', apply=) def echo(ws): while True: msg = ws.receive() if msg is not None: ws.send(msg) else: breakAnd then use the provided server: run(host='127.0.0.1', port=8080, server=GeventWebSocketServer)Product's homepage
bottle-websocket Related Software