{"id":23713,"library":"fastapi-socketio","title":"FastAPI SocketIO","description":"A library to easily integrate Socket.IO with FastAPI applications. Current version is 0.0.10, last updated in 2022. Release cadence is low, with infrequent updates. It wraps the python-socketio library for ASGI mode.","status":"maintenance","version":"0.0.10","language":"python","source_language":"en","source_url":"https://github.com/pyropy/fastapi-socketio","tags":["fastapi","socket.io","websocket","async"],"install":[{"cmd":"pip install fastapi-socketio","lang":"bash","label":"Default install"}],"dependencies":[{"reason":"Core dependency for Socket.IO functionality","package":"python-socketio","optional":false},{"reason":"Required for FastAPI app integration","package":"fastapi","optional":false}],"imports":[{"note":"","wrong":null,"symbol":"SocketManager","correct":"from fastapi_socketio import SocketManager"}],"quickstart":{"code":"from fastapi import FastAPI\nfrom fastapi_socketio import SocketManager\n\napp = FastAPI()\nsocket_manager = SocketManager(app=app)\n\n@app.get(\"/\")\ndef read_root():\n    return {\"Hello\": \"World\"}\n\n@socket_manager.on('connect')\nasync def handle_connect(sid, environ):\n    print(f\"Client connected: {sid}\")\n\n@socket_manager.on('disconnect')\nasync def handle_disconnect(sid):\n    print(f\"Client disconnected: {sid}\")\n\n@socket_manager.on('message')\nasync def handle_message(sid, data):\n    await socket_manager.emit('response', {'data': 'Received'}, room=sid)\n\nif __name__ == \"__main__\":\n    import uvicorn\n    uvicorn.run(app, host=\"0.0.0.0\", port=8000)","lang":"python","description":"Basic setup with FastAPI and SocketManager handling connect, disconnect, and message events."},"warnings":[{"fix":"Use one SocketManager per app. For multiple endpoints, consider custom handling.","message":"SocketManager is not an ASGI application itself; the library does not support multiple socket.io endpoints out of the box.","severity":"gotcha","affected_versions":"all"},{"fix":"Leave `async_mode` unset or set to 'asgi' for typical FastAPI usage.","message":"The `async_mode` argument defaults to 'asgi'. Setting it to 'sanic' or 'aiohttp' may break ASGI compatibility.","severity":"gotcha","affected_versions":"0.0.8+"},{"fix":"Consider using python-socketio's built-in ASGIApp directly (see python-socketio docs).","message":"The library is no longer actively maintained; last release in 2022. May have compatibility issues with newer FastAPI or python-socketio versions.","severity":"deprecated","affected_versions":">=0.0.10"}],"env_vars":null,"search_vec":"'0.0.10':15 '2022':19 'applic':11 'asgi':35 'async':40 'cadenc':21 'current':12 'easili':6 'fastapi':1,10,37 'infrequ':25 'integr':7 'last':16 'librari':4,33 'low':23 'mode':36 'python':31 'python-socketio':30 'releas':20 'socket.io':8,38 'socketio':2,32 'updat':17,26 'version':13 'websocket':39 'wrap':28","created_at":"2026-05-01T08:09:14.157876+00:00","updated_at":"2026-05-01T08:09:14.157876+00:00","problems":[{"fix":"Use: from fastapi_socketio import SocketManager","cause":"Incorrect import path; used old pattern or installed wrong package.","error":"ImportError: cannot import name 'SocketManager' from 'fastapi_socketio'"},{"fix":"Pass the app: SocketManager(app=app)","cause":"SocketManager initialized without passing the FastAPI app object.","error":"RuntimeError: You cannot use SocketManager without an app"},{"fix":"Use SocketManager(app=app, cors_allowed_origins=[]) is invalid. Instead configure CORS via FastAPI middleware.","cause":"CORS configuration is not passed to SocketManager directly; it must be set at the ASGI level.","error":"TypeError: __init__() got an unexpected keyword argument 'cors_allowed_origins'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.0.10","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/pyropy/fastapi-socketio","docs":null,"changelog":"https://github.com/pyropy/fastapi-socketio/releases","pypi":"https://pypi.org/project/fastapi-socketio/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["http-networking","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-29","last_verified":"2026-06-29","next_check":"2026-07-29","install_tag":null}}