{"id":16554320,"url":"https://github.com/ksenginew/wsocket","last_synced_at":"2025-03-16T20:30:21.177Z","repository":{"id":37701963,"uuid":"274337753","full_name":"ksenginew/WSocket","owner":"ksenginew","description":"Simple WSGI HTTP + Websocket Server, Framework, Middleware And App.","archived":false,"fork":false,"pushed_at":"2024-08-16T10:52:46.000Z","size":164,"stargazers_count":25,"open_issues_count":5,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-12T04:08:22.017Z","etag":null,"topics":["app","framework","handler","http","middleware","python","server","single-file","websocket","wsgi","wsgiref","wsocket"],"latest_commit_sha":null,"homepage":"https://wsocket.gitbook.io/","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/ksenginew.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":"2020-06-23T07:24:14.000Z","updated_at":"2025-01-13T10:55:50.000Z","dependencies_parsed_at":"2024-10-11T20:02:16.085Z","dependency_job_id":null,"html_url":"https://github.com/ksenginew/WSocket","commit_stats":null,"previous_names":["ksengine/wsocket"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksenginew%2FWSocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksenginew%2FWSocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksenginew%2FWSocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksenginew%2FWSocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ksenginew","download_url":"https://codeload.github.com/ksenginew/WSocket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826798,"owners_count":20354221,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["app","framework","handler","http","middleware","python","server","single-file","websocket","wsgi","wsgiref","wsocket"],"created_at":"2024-10-11T19:51:12.854Z","updated_at":"2025-03-16T20:30:20.823Z","avatar_url":"https://github.com/ksenginew.png","language":"Python","readme":"[![Downloads](https://static.pepy.tech/personalized-badge/wsocket?period=total\u0026units=none\u0026left_color=black\u0026right_color=blue\u0026left_text=downloads)](https://pepy.tech/project/wsocket) \n [![GitHub issues](https://img.shields.io/github/issues/Ksengine/WSocket?style=flat-square)](https://github.com/Ksengine/WSocket/issues) \n [![GitHub forks](https://img.shields.io/github/forks/Ksengine/WSocket?style=flat-square)](https://github.com/Ksengine/WSocket/network) \n [![GitHub stars](https://img.shields.io/github/stars/Ksengine/WSocket?style=flat-square)](https://github.com/Ksengine/WSocket/stargazers) \n [![GitHub license](https://img.shields.io/github/license/Ksengine/WSocket?style=flat-square)](https://github.com/Ksengine/WSocket/blob/master/LICENSE) \n [![Twitter](https://img.shields.io/twitter/url?style=social\u0026url=https%3A%2F%2Fgithub.com%2FKsengine%2FWSocket)](https://twitter.com/intent/tweet?text=Wow:\u0026url=https%3A%2F%2Fgithub.com%2FKsengine%2FWSocket) \n\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/Ksengine/WSocket\"\u003e\n    \u003cimg src=\"https://github.com/Ksengine/WSocket/raw/master/assests/icon.png\" alt=\"Logo\" width=\"100\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n  \u003ch1 align=\"center\"\u003eWSocket\u003c/h1\u003e\n\n  \u003cp align=\"center\"\u003e\n    \u003cb\u003eSimple WSGI HTTP + Websocket Server, Framework, Middleware And App.\u003c/b\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/Ksengine/WSocket\"\u003e\u003cstrong\u003eExplore the docs »\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n    \u003cbr /\u003e\n    \u003ca href=\"https://pypi.org/project/WSocket\"\u003ePyPI\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/Ksengine/WSocket/issues\"\u003eReport Bug\u003c/a\u003e\n    ·\n    \u003ca href=\"https://github.com/Ksengine/WSocket/issues\"\u003eRequest Feature\u003c/a\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\n## About The Project\n\nThis is a simple library to add websocket support to WSGI.\n\n- Server - Patched wsgiref server\n- Middleware - Add websocket support to Flask, Django, Pyramid, Bottle, ...\n- Handler - Websocket handler to wsgiref\n- Framework - Basic websocket + WSGI web application framework\n- App - Plug and play demo app.\n\n## Getting Started\n\nThis is an example of how you may give instructions on setting up your websocket connunication locally. \n\n### Installation\nYou can\n- Installing from PyPI\n- Download:down_arrow: and Include\n\n#### Installing from PyPI\n\nInstall latest version or upgrade an already installed WSocket to the latest from PyPI.\n```bash\npip install --upgrade wsocket\n```\n\n#### Download and Include\n\n- Visit [wsocket.py](https://raw.githubusercontent.com/Ksengine/WSocket/master/wsocket.py/).\n- Save file (`ctrl+s` in browser).\n- Include in your package derectory.\n```\n    my-app/\n    ├─ hello_world.py\n    ├─ wsocket.py\n```\n\n## Usage\n\n- Include following source on your test file(eg:-`hello_world.py`).\n```python\nfrom wsocket import WSocketApp, WebSocketError, logger, run\nfrom time import sleep\n\nlogger.setLevel(10)  # for debugging\n\ndef on_close(self, message, client):\n    print(repr(client) + \" : \" + message)\n\ndef on_connect(client):\n    print(repr(client) + \" connected\")\n\ndef on_message(message, client):\n    print(repr(clent) + \" : \" + repr(message))\n    try:\n        client.send(\"you said: \" + message)\n        sleep(2)\n        client.send(\"you said: \" + message)\n\n    except WebSocketError:\n        pass\n\napp = WSocketApp()\napp.onconnect += on_connect\napp.onmessage += on_message\napp.onclose += on_close\n\nrun(app)\n```\n- Visit [client.html](https://github.com/Ksengine/WSocket/raw/master/client.html).\n- Save file (`ctrl+s` in browser).\n- Open it in browser(websocket supported).\n- Experience the two way websocket communication. :smile::smile::smile:\n\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the Project\n2. Create your Feature Branch (`git checkout -b feature/AmazingFeature`)\n3. Commit your Changes (`git commit -m 'Add some AmazingFeature'`)\n4. Push to the Branch (`git push origin feature/AmazingFeature`)\n5. Open a Pull Request\n\n\n## License\nCode and documentation are available according to the MIT License (see  [LICENSE](https://github.com/Ksengine/WSocket/blob/master/LICENSE)).\n\n\n## Contact\n**Report Bugs** - https://github.com/Ksengine/WSocket/issues/new/\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksenginew%2Fwsocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksenginew%2Fwsocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksenginew%2Fwsocket/lists"}