Socket.IO integration for Flask applications.
Go to file
Miguel Grinberg 16fea7a246
Version 5.4.1.dev0
2024-09-30 18:40:15 +01:00
.github Drop Python 3.7, add Python 3.12, upgrade to pypy 3.10 2024-04-28 00:41:14 +01:00
docs Source code order for documented methods of a class #nolog 2023-09-08 20:04:31 +01:00
example Support catch all events (Fixes #2095) 2024-09-29 20:45:06 +01:00
src/flask_socketio Support catch all events (Fixes #2095) 2024-09-29 20:45:06 +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.4.0 2024-09-30 18:38:10 +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
README.md Improved project structure 2021-06-07 20:18:52 +01:00
SECURITY.md Create SECURITY.md 2021-07-04 11:54:53 +01:00
pyproject.toml Version 5.4.1.dev0 2024-09-30 18:40:15 +01:00
test_socketio.py Support catch all events (Fixes #2095) 2024-09-29 20:45:06 +01:00
tox.ini Drop Python 3.7, add Python 3.12, upgrade to pypy 3.10 2024-04-28 00:41:14 +01:00

README.md

Flask-SocketIO

Build status codecov

Socket.IO integration for Flask applications.

Sponsors

The following organizations are funding this project:

Socket.IO
Socket.IO
Add your company here!

Many individual sponsors also support this project through small ongoing contributions. Why not join them?

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