--- id: flask-sock version: "0.7.0" license: unclear license_treatment: permissive maintenance: active --- # flask-sock — WebSocket support for Flask License: permissive · Maintenance: active · Downloads: 2.1M/mo ## 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 above — verify before relying. Adds WebSocket support to Flask applications without requiring greenlet-based servers, working with the Flask development server and production deployments via Gunicorn, Eventlet, or Gevent. 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 pip install flask-sock uv add flask-sock poetry add flask-sock ## Installing flask-sock 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. 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) Requires Python 3.6 or later; for production use, deploy with Gunicorn, Eventlet, or Gevent rather than the Flask development server. 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: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 2.1M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags flask websocket support, websocket extension for flask, real-time communication flask, bidirectional web communication, flask ws server, websocket without gevent, flask socket connection, websocket, real-time-communication, flask-extension [View on SkillFed](https://skillfed.io/packages/flask-sock) · [View on PyPI](https://pypi.org/project/flask-sock/)