The Wayback Machine - https://web.archive.org/web/20190322173623/https://github.com/miguelgrinberg/Flask-SocketIO
Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Socket.IO integration for Flask applications.
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs discontinue the customized flask run command Jan 22, 2019
example spelling corrected (#869) Jan 7, 2019
flask_socketio Release 3.3.2 Mar 9, 2019
.gitignore
.travis.yml
LICENSE first release Feb 10, 2014
MANIFEST.in include license and readme in the package Sep 15, 2016
README.md add link to stack overflow for questions Mar 16, 2019
setup.py update dependencies Mar 9, 2019
test_socketio.py keep connected status in test client Feb 16, 2019

README.md

Flask-SocketIO

Build Status

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.on('my event')
def test_message(message):
    emit('my response', {'data': 'got it!'})

if __name__ == '__main__':
    socketio.run(app)

Resources

You can’t perform that action at this time.