skillfed

Flask-SocketIO

Socket.IO integration for Flask applications

flask-socketio v5.6.1 5.2M downloads/30d#2,130 on PyPI5,508
Permissive license Active released

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-socketio

uv

uv add flask-socketio

poetry

poetry add flask-socketio

Installing 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

Environment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

websocket flaskreal-time communication pythonsocket.io flask integrationbidirectional messaging weblive event streaming flaskwebsocket server pythonflask real-time events
websocketreal-timeevent-driven

More Dynamic Content packages