Socket.IO integration for Flask applications.
  • Python 89.6%
  • HTML 10.4%
Find a file
Miguel Grinberg 4c4d56b758
All checks were successful
build / tests-3.11 (push) Successful in 1m5s
build / tests-3.12 (push) Successful in 1m14s
build / tests-3.10 (push) Successful in 1m18s
build / lint (push) Successful in 1m21s
build / tests-3.13 (push) Successful in 1m12s
build / tests-3.14 (push) Successful in 1m20s
build / tests-3.10 <2.2 (push) Successful in 1m17s
build / tests-3.11 <2.2 (push) Successful in 1m11s
build / tests-3.12 <2.2 (push) Successful in 1m21s
build / tests-3.13 <2.2 (push) Successful in 1m25s
build / tests-pypy-3.11 (push) Successful in 2m54s
build / tests-3.10 <3.0 (push) Successful in 1m17s
build / tests-3.11 <3.0 (push) Successful in 1m12s
build / tests-3.12 <3.0 (push) Successful in 1m17s
build / tests-pypy-3.11 <2.2 (push) Successful in 2m50s
build / tests-3.13 <3.0 (push) Successful in 1m19s
build / tests-3.14 <3.0 (push) Successful in 1m27s
build / tests-3.10 <3.1 (push) Successful in 1m14s
build / tests-3.11 <3.1 (push) Successful in 1m14s
build / tests-3.12 <3.1 (push) Successful in 1m17s
build / tests-pypy-3.11 <3.0 (push) Successful in 2m53s
build / tests-3.13 <3.1 (push) Successful in 1m21s
build / tests-3.14 <3.1 (push) Successful in 1m22s
build / tests-3.10 <3.2 (push) Successful in 1m13s
build / tests-3.11 <3.2 (push) Successful in 1m9s
build / tests-3.12 <3.2 (push) Successful in 1m14s
build / tests-3.13 <3.2 (push) Successful in 1m17s
build / tests-pypy-3.11 <3.1 (push) Successful in 2m54s
build / tests-3.14 <3.2 (push) Successful in 1m6s
build / tests-pypy-3.11 <3.2 (push) Successful in 1m31s
Version 5.7.1.dev0
2026-10-09 00:17:13 +01:00
.forgejo/workflows continuous integration improvements 2026-10-08 20:53:00 +01:00
docs Error handling in class-based namespaces (Fixes #10001) 2026-10-08 20:47:13 +01:00
example Bump jinja2 from 3.1.3 to 3.1.5 in /example (#2125) #nolog 2024-12-24 16:23:56 +00:00
src/flask_socketio Error handling in class-based namespaces (Fixes #10001) 2026-10-08 20:47:13 +01:00
.gitignore Version 5.7.1.dev0 2026-10-09 00:17:13 +01:00
.readthedocs.yaml Forgejo migration 2026-08-29 20:23:35 +01:00
.travis.yml update travis build versions #nolog 2020-02-15 00:29:20 +01:00
CHANGES.md Release 5.7.0 2026-10-08 23:55:44 +01:00
CODE_OF_CONDUCT.md Forgejo migration 2026-08-29 20:23:35 +01:00
CONTRIBUTING.md Forgejo migration 2026-08-29 20:23:35 +01:00
LICENSE first release 2014-02-09 19:46:51 -08:00
MANIFEST.in Migrate Python package metadata to pyproject.toml 2023-10-15 13:00:59 +01:00
pyproject.toml Version 5.7.1.dev0 2026-10-09 00:17:13 +01:00
README.md Forgejo migration 2026-08-29 20:23:35 +01:00
SECURITY.md Forgejo migration 2026-08-29 20:23:35 +01:00
test_socketio.py Better integration with pytest 2026-10-08 22:55:55 +01:00
tox.ini continuous integration improvements 2026-10-08 20:53:00 +01:00

Flask-SocketIO

tests

Socket.IO integration for Flask applications.

Installation

You can install this package as usual with pip:

pip install flask-socketio

Example

from flask import Flask, render_template
from flask_socketio import SocketIO, emit
    
app = Flask(__name__)
app.config['SECRET_KEY'] = 'secret!'
socketio = SocketIO(app)

@app.route('/')
def index():
    return render_template('index.html')

@socketio.event
def my_event(message):
    emit('my response', {'data': 'got it!'})

if __name__ == '__main__':
    socketio.run(app)

Resources

Sponsor this project

This project relies on contributions from its users. If you benefit from it please consider making a single or ongoing monetary contribution in one of the following platforms:

Thank you!