Socket.IO integration for Flask applications.
- Python 89.7%
- HTML 10.3%
|
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/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!