https://github.com/miguelgrinberg/python-socketio
Python Socket.IO server and client
https://github.com/miguelgrinberg/python-socketio
asyncio eventlet gevent long-polling low-latency python socket-io socketio socketio-server web-server websocket
Last synced: 24 days ago
JSON representation
Python Socket.IO server and client
- Host: GitHub
- URL: https://github.com/miguelgrinberg/python-socketio
- Owner: miguelgrinberg
- License: mit
- Created: 2015-07-15T06:17:03.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2025-08-30T09:52:04.000Z (about 1 month ago)
- Last Synced: 2025-09-03T06:30:34.450Z (about 1 month ago)
- Topics: asyncio, eventlet, gevent, long-polling, low-latency, python, socket-io, socketio, socketio-server, web-server, websocket
- Language: Python
- Homepage:
- Size: 1.77 MB
- Stars: 4,237
- Watchers: 61
- Forks: 611
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE
- Security: SECURITY.md
Awesome Lists containing this project
- awesome-django - python-socketio - Python implementation of the Socket.IO_ realtime client and server. [(create Socket.io Django server instance)](https://python-socketio.readthedocs.io/en/latest/server.html?highlight=django#creating-a-server-instance) (Python Packages / Templates)
- best-of-web-python - GitHub - 1% open · ⏱️ 24.09.2025): (Websocket Utilities)
- StarryDivineSky - miguelgrinberg/python-socketio - socketio是一个基于Python的Socket.IO实现项目,包含服务器端和客户端代码。该项目主要用于构建实时双向通信应用,支持WebSocket协议并兼容HTTP长轮询,适用于需要实时数据传输的场景如聊天室、在线游戏或实时仪表盘。其核心特色是事件驱动架构,允许开发者通过定义事件名称和回调函数处理客户端与服务端之间的消息交互,同时内置自动重连机制确保网络中断后的连接恢复。项目支持多种消息格式,包括文本、JSON和二进制数据,并提供加密传输功能以增强安全性。开发者的使用流程通常包括安装依赖库、编写服务器端代码监听连接和事件,以及客户端代码建立连接并发送接收消息。项目文档详细说明了如何通过命令行工具运行服务器,以及如何在不同框架如Flask或Django中集成Socket.IO功能。此外,该项目还包含示例代码演示基本用法和高级功能,如命名空间、房间管理及消息广播。开发者可通过pip安装该库,依赖项包括eventlet或gevent等异步网络库以及python-socketio本身的模块。项目强调轻量级设计和跨平台兼容性,支持在多种操作系统和Python环境中运行,同时提供详细的API文档和社区支持,方便开发者快速上手和调试。 (网络信息服务 / 网络协议)
README
python-socketio
===============[](https://github.com/miguelgrinberg/python-socketio/actions) [](https://codecov.io/gh/miguelgrinberg/python-socketio)
Python implementation of the `Socket.IO` realtime client and server.
Sponsors
--------The following organizations are funding this project:

[Socket.IO](https://socket.io) | [Add your company here!](https://github.com/sponsors/miguelgrinberg)|
-|-Many individual sponsors also support this project through small ongoing contributions. Why not [join them](https://github.com/sponsors/miguelgrinberg)?
Version compatibility
---------------------The Socket.IO protocol has been through a number of revisions, and some of these
introduced backward incompatible changes, which means that the client and the
server must use compatible versions for everything to work.If you are using the Python client and server, the easiest way to ensure compatibility
is to use the same version of this package for the client and the server. If you are
using this package with a different client or server, then you must ensure the
versions are compatible.The version compatibility chart below maps versions of this package to versions
of the JavaScript reference implementation and the versions of the Socket.IO and
Engine.IO protocols.JavaScript Socket.IO version | Socket.IO protocol revision | Engine.IO protocol revision | python-socketio version
-|-|-|-
0.9.x | 1, 2 | 1, 2 | Not supported
1.x and 2.x | 3, 4 | 3 | 4.x
3.x and 4.x | 5 | 4 | 5.xResources
---------- [Documentation](http://python-socketio.readthedocs.io/)
- [PyPI](https://pypi.python.org/pypi/python-socketio)
- [Change Log](https://github.com/miguelgrinberg/python-socketio/blob/main/CHANGES.md)
- Questions? See the [questions](https://stackoverflow.com/questions/tagged/python-socketio) others have asked on Stack Overflow, or [ask](https://stackoverflow.com/questions/ask?tags=python+python-socketio) your own question.