Flask-SocketIO
Socket.IO integration for Flask applications
What it is and what it does
Flask-SocketIO bridges Flask applications with Socket.IO, a library that enables real-time, event-driven communication between server and client over WebSockets. It wraps the python-socketio package and integrates it into Flask's request/response model, letting you define event handlers as decorators and emit messages bidirectionally. The package depends on flask, python-socketio, werkzeug, jinja2, click, and blinker—all standard Flask ecosystem components.
Typical use is defining server-side event handlers with @socketio.event decorators, then running the app with socketio.run() instead of app.run(). Clients connect via a JavaScript Socket.IO client library and exchange JSON-serializable messages. This pattern is common for live dashboards, collaborative tools, notifications, and any application where the server needs to push updates to connected clients without polling.
Use it for:
- Build live notification systems where the server pushes alerts to connected browsers in real time.
- Create collaborative editing or whiteboarding applications with instant synchronization across clients.
- Implement live dashboards and monitoring interfaces that update without page refresh.
- Add real-time chat or messaging features to Flask web applications.
- Stream live data (stock prices, sensor readings, game state) to multiple clients simultaneously.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Flask-SocketIO adds real-time bidirectional communication to Flask applications using WebSockets, allowing servers and clients to emit and receive events instantly.
Yes. Flask-SocketIO is actively maintained, has low install friction, carries a permissive MIT license, and solves a real problem—adding WebSocket support to Flask with minimal boilerplate. It's in the top 5000 packages by downloads and has no known vulnerabilities. Install it if you need real-time bidirectional communication in a Flask app.
Install
flask-socketio on PyPI
pip
pip install flask-socketiouv
uv add flask-socketiopoetry
poetry add flask-socketioInstalling Flask-SocketIO
Before you install
Low friction install with a pure-Python wheel. Actively maintained with recent releases; last commit 2026-07-30 and 5508 repository stars indicate ongoing support.
License in practice
MIT license (permissive) means you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install flask-socketio
from flask import Flask
from flask_socketio import SocketIO, emit
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app)
@socketio.event
def my_event(message):
emit('my_response', {'data': 'got it!'})
if __name__ == '__main__':
socketio.run(app)
Requires Python 3.8 or later; production deployment typically needs a production WSGI server and may require additional configuration for WebSocket support.
Verify before relying
- Whether the package handles reconnection and fallback transports automatically or requires manual configuration.
- Performance characteristics and scalability limits for concurrent connections.
- Specific deployment requirements beyond standard Flask WSGI servers.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — blinker, click, flask, Flask, jinja2, python-socketio, werkzeug |
| Maintenance | actively maintained — 174 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,242,836/month — #2,130 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: flask_socketio-5.6.1-py3-none-any.whl
Tags
More Dynamic Content packages
MarkupSafe provides a text object that escapes…
permissive · top 100 on PyPI
Jinja2Jinja2 is a templating engine that renders…
permissive · top 100 on PyPI
soupsieveSoupsieve is a CSS selector library designed to…
permissive · top 100 on PyPI
WerkzeugWerkzeug is a WSGI utility library providing…
permissive · top 1,000 on PyPI
FlaskFlask is a lightweight WSGI web application…
permissive · top 1,000 on PyPI
MakoMako compiles Python-embedded templates into…
permissive · top 1,000 on PyPI
fastapi-socketioIntegrates Socket.IO real-time bidirectional…
permissive · top 15,000 on PyPI
flask-sockAdds WebSocket support to Flask applications…
permissive · top 5,000 on PyPI
python-socketioPython implementation of Socket.IO realtime…
permissive · top 1,000 on PyPI
simple-websocketProvides a straightforward WebSocket server and…
permissive · top 1,000 on PyPI
python-engineioPython implementation of the Engine.IO realtime…
permissive · top 1,000 on PyPI
websocketProvides WebSocket protocol support for…
permissive · top 15,000 on PyPI
bottle-websocketAdds WebSocket support to the Bottle web…
permissive · top 15,000 on PyPI
ws4pyws4py implements the WebSocket protocol (RFC…
permissive · top 15,000 on PyPI
gevent-websocketProvides WebSocket support for gevent-based…
unclear · top 5,000 on PyPI
websocketswebsockets is a library for building WebSocket…
permissive · top 100 on PyPI