flask-sock
WebSocket support for Flask
Decision gist · record as of 2026-08-14
Yes, if you need WebSocket support in Flask and want to avoid greenlet-based servers during development. The package is actively maintained, has no known vulnerabilities, installs with minimal friction, and uses a permissive MIT license. It's well-suited for adding real-time features to existing Flask projects without major architectural changes.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.6 or later; for production use, deploy with Gunicorn, Eventlet, or Gevent rather than the Flask development server.
- Low friction: pure Python wheel with only two runtime dependencies (flask and simple-websocket).
- Actively maintained with recent commits and no known vulnerabilities.
License · maintenance · safety
permissive license (permissive) — MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you include the license notice.
last release 2023-10-02 (1047 days) · last repo commit 2026-05-14 · 317 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 2,103,188 downloads/mo, #3,294 on PyPI
Alternatives
Verify before relying
pip install flask-sock
from flask import Flask
from flask_sock import Sock
app = Flask(__name__)
sock = Sock(app)
@sock.route('/echo')
def echo(ws):
while True:
data = ws.receive()
ws.send(data)- Whether the package's WebSocket implementation handles connection pooling or scales to high concurrency loads.
- Performance characteristics compared to other Flask WebSocket extensions in production deployments.
What it is and what it does
flask-sock is a Flask extension that adds WebSocket support to your application. Unlike some alternatives, it does not require a greenlet-based application server to function—it works out of the box with Flask's development server and can be deployed to production using standard WSGI servers like Gunicorn alongside Eventlet or Gevent for async handling. The extension integrates cleanly into Flask's routing model, letting you decorate handler functions to receive and send WebSocket messages.
The package depends on flask and simple-websocket for its core functionality. It's designed for developers who want bidirectional communication in Flask applications without the overhead of setting up a specialized server environment during development. For production, you pair it with an appropriate deployment strategy—Gunicorn with Eventlet or Gevent workers, or a standalone Eventlet/Gevent server.
Use it for
- Build real-time chat or notification systems in Flask without switching to a specialized async framework.
- Add live data streaming or dashboard updates to existing Flask applications.
- Implement collaborative editing or multiplayer features where clients need instant server-to-client messaging.
- Create interactive debugging or monitoring tools that push status updates to connected clients.
- Develop browser-based games or interactive applications requiring low-latency bidirectional communication.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need WebSocket support in Flask and want to avoid greenlet-based servers during development.
The package is actively maintained, has no known vulnerabilities, installs with minimal friction, and uses a permissive MIT license. It's well-suited for adding real-time features to existing Flask projects without major architectural changes.
Install
flask-sock on PyPI
Before you install
Low friction: pure Python wheel with only two runtime dependencies (flask and simple-websocket). Actively maintained with recent commits and no known vulnerabilities.
Requires Python 3.6 or later; for production use, deploy with Gunicorn, Eventlet, or Gevent rather than the Flask development server.
License in practice
MIT license permits commercial and private use with minimal restrictions; you may use, modify, and distribute the package freely provided you include the license notice.
Quickstart
pip install flask-sock
from flask import Flask
from flask_sock import Sock
app = Flask(__name__)
sock = Sock(app)
@sock.route('/echo')
def echo(ws):
while True:
data = ws.receive()
ws.send(data)
Verify before relying
- Whether the package's WebSocket implementation handles connection pooling or scales to high concurrency loads.
- Performance characteristics compared to other Flask WebSocket extensions in production deployments.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.6 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesflasksimple-websocket |
| Maintenance | Actively maintained 1,047 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 2,103,188 / month, #3,294 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Environment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3 |
Evidence: flask_sock-0.7.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “flask websocket support”
- flask-sockAdds WebSocket support to Flask applications without requiring…
- Flask-SocketIOFlask-SocketIO adds real-time bidirectional communication to Flask…
- aiohttp-wsgiRuns WSGI applications like Django and Flask on aiohttp, enabling…
Give your agent the search over MCP, or paste the wish link into any chat.
More Dynamic Content packages
MarkupSafe provides a text object that escapes special characters so untrusted strings can be safely embedded in HTML and XML without injection attacks.
Jinja2 is a templating engine that renders dynamic content by combining templates with Python-like syntax and data, supporting template inheritance, macros, autoescaping, and sandboxed execution.
Soupsieve is a CSS selector library designed to work with Beautiful Soup 4 to select, match, and filter HTML and XML elements using modern CSS selectors from CSS level 1 through CSS level 4 specifications.
Install it if you use Beautiful Soup for HTML or XML parsing and want modern CSS selector support.
Werkzeug is a WSGI utility library providing request/response objects, URL routing, an interactive debugger, HTTP utilities, and a development server for building web applications.
Flask is a lightweight WSGI web application framework for building web applications in Python, from simple single-page sites to complex multi-route applications.
Mako compiles Python-embedded templates into Python modules for fast rendering, supporting layout inheritance, custom functions, and direct Python expressions within template syntax.
See also Flask-SocketIO · bottle-websocket · gevent-websocket · websocket · simple-websocket · grequests · ws4py · gevent · lomond · zwave-js-server-python