Socket.IO integration for Flask applications.
- Python 89.6%
- HTML 10.4%
|
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
|
||
|---|---|---|
| .forgejo/workflows | ||
| docs | ||
| example | ||
| src/flask_socketio | ||
| .gitignore | ||
| .readthedocs.yaml | ||
| .travis.yml | ||
| CHANGES.md | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| LICENSE | ||
| MANIFEST.in | ||
| pyproject.toml | ||
| README.md | ||
| SECURITY.md | ||
| test_socketio.py | ||
| tox.ini | ||
Flask-SocketIO
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!