Socket.IO integration for Flask applications.
  • Python 89.7%
  • HTML 10.3%
Find a file
Miguel Grinberg f63afe0aa9
All checks were successful
build / tests-3.10 (push) Successful in 1m14s
build / lint (push) Successful in 1m51s
build / tests-3.11 (push) Successful in 1m6s
build / tests-3.12 (push) Successful in 1m15s
build / tests-3.13 (push) Successful in 1m16s
build / tests-3.14 (push) Successful in 1m21s
build / tests-3.11 <2.2 (push) Successful in 1m11s
build / tests-3.10 <2.2 (push) Successful in 1m21s
build / tests-3.12 <2.2 (push) Successful in 1m18s
build / tests-3.13 <2.2 (push) Successful in 1m24s
build / tests-pypy-3.11 (push) Successful in 3m4s
build / tests-3.10 <3.0 (push) Successful in 1m15s
build / tests-3.11 <3.0 (push) Successful in 1m12s
build / tests-3.12 <3.0 (push) Successful in 1m18s
build / tests-3.13 <3.0 (push) Successful in 1m17s
build / tests-pypy-3.11 <2.2 (push) Successful in 3m6s
build / tests-3.14 <3.0 (push) Successful in 1m30s
build / tests-3.11 <3.1 (push) Successful in 1m15s
build / tests-3.10 <3.1 (push) Successful in 1m22s
build / tests-3.12 <3.1 (push) Successful in 1m27s
build / tests-3.13 <3.1 (push) Successful in 1m23s
build / tests-3.14 <3.1 (push) Successful in 1m27s
build / tests-pypy-3.11 <3.0 (push) Successful in 3m26s
build / tests-3.10 <3.2 (push) Successful in 1m19s
build / tests-3.11 <3.2 (push) Successful in 1m11s
build / tests-3.12 <3.2 (push) Successful in 1m14s
build / tests-3.13 <3.2 (push) Successful in 1m21s
build / tests-3.14 <3.2 (push) Successful in 1m29s
build / zizmor (push) Successful in 12s
build / tests-pypy-3.11 <3.1 (push) Successful in 3m4s
build / tests-pypy-3.11 <3.2 (push) Successful in 3m5s
Forgejo migration
2026-08-29 20:23:35 +01:00
.forgejo/workflows Forgejo migration 2026-08-29 20:23:35 +01:00
docs Switch to Furo documentation template 2026-02-21 10:52:19 +00: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 fix: replace bare except with except Exception in __init__.py (#2159) 2026-07-30 22:58:52 +01:00
.gitignore helper release script 2019-05-19 18:52:35 +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.6.1 2026-02-21 13:07:15 +00: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.6.2.dev0 2026-02-21 13:07:54 +00: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 Add a reason argument to the disconnect handler 2024-12-18 18:15:01 +00:00
tox.ini tox configuration 2026-05-14 23:21:04 +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!