whatisgithub

What is flask-socketio?

miguelgrinberg/flask-socketio — explained in plain English

Analysis updated 2026-06-26

5,509PythonAudience · developerComplexity · 2/5Setup · easy

In one sentence

A Python package that adds real-time, two-way messaging between a Flask web app and browsers using Socket.IO, so the server can push updates instantly without polling, enabling chat, live dashboards, and collaborative tools.

Mindmap

mindmap
  root((repo))
    What it does
      Real-time messaging
      Push server updates
      Event-driven handlers
    Tech Stack
      Python
      Flask
      Socket.IO
    Use Cases
      Chat applications
      Live dashboards
      Collaborative editing
    Setup
      pip install
      Wrap Flask app
      One-line server start
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add a real-time chat feature to an existing Flask website where messages appear instantly without page reloads

USE CASE 2

Build a live dashboard that pushes server-side updates to all connected browsers the moment data changes

USE CASE 3

Create a collaborative editing tool where multiple users see each other's changes in real time

What is it built with?

PythonFlaskSocket.IO

How does it compare?

miguelgrinberg/flask-socketioapple/ml-depth-propennyw0rth/netexec
Stars5,5095,5075,511
LanguagePythonPythonPython
Setup difficultyeasyhardmoderate
Complexity2/54/54/5
Audiencedeveloperresearcherops devops

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 30min

Requires pip install of flask-socketio and a compatible async worker like eventlet or gevent for production.

So what is it?

Flask-SocketIO is a Python package that lets a Flask web application communicate with a browser in real time, sending messages back and forth without the browser needing to repeatedly ask the server for updates. Flask is a popular, lightweight framework for building websites and APIs in Python. Socket.IO is a protocol that keeps an open connection between a browser and a server so either side can send a message at any moment. This package wires the two together. Without something like this, a web page has to refresh or poll the server every few seconds to check for new information. With Flask-SocketIO, the server can push a message to the browser the instant something happens, and the browser can reply. This makes it practical to build things like chat applications, live dashboards, or collaborative editing tools on top of a Flask backend. Installing the package is a single pip command. Once installed, you wrap your existing Flask app with the SocketIO object, then define event handlers using a decorator. The short example in the README shows an app that listens for an event called my_event and immediately emits a response back to whoever sent it. Starting the server is one line of code. The README is brief and mostly contains the installation instruction and a minimal code sample. For a fuller picture of what the library can do, such as broadcasting to multiple connected clients, handling rooms, or integrating with authentication, the official documentation is available on Read the Docs and a tutorial exists on the author's blog. Questions from the community are also archived on Stack Overflow under the flask-socketio tag.

Copy-paste prompts

Prompt 1
I have a Flask app and want to add real-time notifications using Flask-SocketIO. Show me how to wrap my Flask app, define a server-side event handler, and send a message back to the client in JavaScript.
Prompt 2
How do I broadcast a Flask-SocketIO event to all connected clients at once instead of just replying to the sender?
Prompt 3
Show me how to use Flask-SocketIO rooms so that only users in the same chat room receive each other's messages.
Prompt 4
How do I integrate Flask-SocketIO with Flask-Login so that only authenticated users can connect via WebSocket?

Frequently asked questions

What is flask-socketio?

A Python package that adds real-time, two-way messaging between a Flask web app and browsers using Socket.IO, so the server can push updates instantly without polling, enabling chat, live dashboards, and collaborative tools.

What language is flask-socketio written in?

Mainly Python. The stack also includes Python, Flask, Socket.IO.

How hard is flask-socketio to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is flask-socketio for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.