Socket.IO integration for Flask applications.
  • Python 89.7%
  • HTML 10.3%
Find a file
2026-07-30 22:58:52 +01:00
.github tox configuration 2026-05-14 23:21:04 +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 Add readthedocs config file 2023-06-13 11:02:32 +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
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 Switch to Furo documentation template 2026-02-21 10:52:19 +00:00
SECURITY.md Create SECURITY.md 2021-07-04 11:54:53 +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

Build status codecov

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