{"id":23850520,"url":"https://github.com/level09/flask-uwsgi-ws","last_synced_at":"2026-02-17T05:32:23.815Z","repository":{"id":265902187,"uuid":"896791204","full_name":"level09/flask-uwsgi-ws","owner":"level09","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-22T13:18:33.000Z","size":109,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-06T13:51:47.635Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/level09.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-01T10:16:41.000Z","updated_at":"2025-03-22T13:18:38.000Z","dependencies_parsed_at":"2024-12-01T13:20:06.600Z","dependency_job_id":"909bee44-83a1-4ef1-94b4-8780c73dc239","html_url":"https://github.com/level09/flask-uwsgi-ws","commit_stats":null,"previous_names":["level09/flask-uwsgi-ws"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/level09/flask-uwsgi-ws","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/level09%2Fflask-uwsgi-ws","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/level09%2Fflask-uwsgi-ws/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/level09%2Fflask-uwsgi-ws/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/level09%2Fflask-uwsgi-ws/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/level09","download_url":"https://codeload.github.com/level09/flask-uwsgi-ws/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/level09%2Fflask-uwsgi-ws/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29534940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T05:00:25.817Z","status":"ssl_error","status_checked_at":"2026-02-17T04:57:16.126Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-01-02T22:19:14.631Z","updated_at":"2026-02-17T05:32:23.797Z","avatar_url":"https://github.com/level09.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flask-uWSGI-WS\n\nA high-performance WebSocket extension for Flask applications powered by uWSGI.\nCompatible with Python 3.12 and newer versions.\n\n## Example Usage\n\n```python\nfrom flask import Flask\nfrom flask_uwsgi_ws import WebSocket\n\napp = Flask(__name__)\nws = WebSocket(app)\n\n@ws.route('/echo')\ndef echo(ws):\n    while True:\n        msg = ws.receive()\n        ws.send(msg)\n\nif __name__ == '__main__':\n    app.run(debug=True, threads=16)\n```\n\n## Installation\n\nTo install Flask-uWSGI-WS, you'll need to install uWSGI with SSL support first:\n\n### For Ubuntu/Debian:\n```bash\nCFLAGS=\"-I/usr/include/openssl\" LDFLAGS=\"-L/usr/lib/x86_64-linux-gnu\" UWSGI_PROFILE_OVERRIDE=ssl=true pip install --no-cache-dir uwsgi --no-binary :all:\n```\n\n### For macOS (Apple Silicon):\n```bash\nCFLAGS=\"-I/opt/homebrew/opt/openssl@3/include\" \\\nLDFLAGS=\"-L/opt/homebrew/opt/openssl@3/lib\" \\\nUWSGI_PROFILE_OVERRIDE=ssl=true pip install --no-cache-dir uwsgi --no-binary :all:\n```\n\nThen install Flask-uWSGI-WS:\n```bash\npip install flask-uwsgi-ws\n```\n\n## Deployment\n\nYou can use uWSGI's built-in HTTP router to get up and running quickly:\n\n```bash\n$ uwsgi --master --http :8080 --http-websockets --wsgi-file app.py\n```\n\n...or call app.run, passing uwsgi any arguments you like:\n\n```python\napp.run(debug=True, host='localhost', port=8080, master=true, processes=8)\n```\n\n### Using with Gevent\n\nuWSGI supports several concurrency models, including Gevent. To use Gevent, import `GeventWebSocket`:\n\n```python\nfrom flask_uwsgi_ws import GeventWebSocket\n```\n\nThen run uWSGI with the gevent loop engine:\n\n```bash\n$ uwsgi --master --http :8080 --http-websockets --gevent 100 --wsgi-file app.py\n```\n\n...or in your code:\n\n```python\napp.run(debug=True, gevent=100)\n```\n\n## Development\n\nTo use Flask's interactive debugger, install werkzeug's DebuggedApplication middleware:\n\n```python\nfrom werkzeug.debug import DebuggedApplication\napp.wsgi_app = DebuggedApplication(app.wsgi_app, True)\n```\n\nThen run uWSGI with a single worker:\n\n```bash\n$ uwsgi --master --http :8080 --http-websockets --wsgi-file --workers 1 --threads 8 app.py\n```\n\nIf you use `app.run(debug=True)`, Flask-uWSGI-WS will do this automatically.\n\n## WebSocket API\n\nFlask-uWSGI-WS handles the WebSocket handshake and provides a websocket client with the following methods:\n\n- `websocket.recv()` - Receive a message\n- `websocket.send(msg)` - Send a message\n- `websocket.send_binary(msg)` - Send a binary message\n- `websocket.recv_nb()` - Non-blocking receive\n- `websocket.send_from_sharedarea(id, pos)` - Send from shared memory area\n- `websocket.send_binary_from_sharedarea(id, pos)` - Send binary from shared memory area","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevel09%2Fflask-uwsgi-ws","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flevel09%2Fflask-uwsgi-ws","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flevel09%2Fflask-uwsgi-ws/lists"}