{"id":23378,"library":"bottle-websocket","title":"Bottle-WebSocket","description":"WebSocket support for the Bottle micro web-framework. Version 0.2.9 is the latest release; the library wraps gevent and GeventWebSocketHandler to provide real-time bidirectional communication. Development appears stalled since 2013.","status":"maintenance","version":"0.2.9","language":"python","source_language":"en","source_url":"https://github.com/zeekay/bottle-websocket","tags":["bottle","websocket","gevent","real-time","micro-framework"],"install":[{"cmd":"pip install bottle-websocket","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The extension is exposed under bottle.ext.websocket, not a top-level module.","symbol":"WebSocket","correct":"from bottle.ext.websocket import WebSocket"},{"note":"The PyPI package uses an underscore, not a hyphen, for Python imports.","wrong":"import gevent-websocket","symbol":"gevent_websocket","correct":"import gevent_websocket"}],"quickstart":{"code":"from bottle import Bottle, request\nfrom bottle.ext.websocket import GeventWebSocketServer\nfrom bottle.ext.websocket import websocket\n\napp = Bottle()\n\n@app.route('/echo')\ndef handle_websocket(ws):\n    while True:\n        msg = ws.receive()\n        if msg is None:\n            break\n        ws.send('echo: ' + msg)\n\nif __name__ == '__main__':\n    from bottle import run\n    run(app, server=GeventWebSocketServer, host='localhost', port=8080)","lang":"python","description":"Basic echo server using Bottle-WebSocket with GeventWebSocketServer."},"warnings":[{"fix":"Pin gevent to 1.0.2 and gevent-websocket to 0.9.5, or consider an alternative like Flask-SocketIO or aiohttp for new projects.","message":"The package has not been updated since 2013 and relies on outdated dependencies (gevent < 1.1, gevent-websocket). Modern versions of gevent may break compatibility.","severity":"gotcha","affected_versions":">=0.2.9"},{"fix":"Pass `server=GeventWebSocketServer` to `run()` or use `app.run(server=GeventWebSocketServer)`.","message":"The server must be GeventWebSocketServer; using Bottle's default server will not handle WebSocket upgrades.","severity":"gotcha","affected_versions":"all"},{"fix":"Test thoroughly with Python 3; consider migrating to a maintained alternative.","message":"Python 2 is no longer supported by the Python ecosystem; this library has not been updated for Python 3 compatibility in many areas.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install bottle-websocket`.","cause":"Bottle-WebSocket is a plugin installed as a separate package; bottle.ext.websocket is only available after installing bottle-websocket.","error":"ImportError: No module named 'bottle.ext'"},{"fix":"Install gevent-websocket: `pip install gevent-websocket`.","cause":"The GeventWebSocketHandler requires gevent-websocket package to be installed separately.","error":"AttributeError: module 'gevent' has no attribute 'websocket'"},{"fix":"Install gevent-websocket: `pip install gevent-websocket`.","cause":"Missing the gevent-websocket dependency.","error":"ImportError: No module named 'gevent_websocket'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}