{"id":13605101,"url":"https://github.com/danni/uwebsockets","last_synced_at":"2025-10-24T09:45:10.847Z","repository":{"id":41403588,"uuid":"67023469","full_name":"danni/uwebsockets","owner":"danni","description":"Micropython websockets implementation","archived":false,"fork":false,"pushed_at":"2023-06-09T06:06:38.000Z","size":45,"stargazers_count":182,"open_issues_count":12,"forks_count":40,"subscribers_count":14,"default_branch":"esp8266","last_synced_at":"2024-08-02T19:36:53.425Z","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/danni.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}},"created_at":"2016-08-31T09:27:43.000Z","updated_at":"2024-07-28T10:23:22.000Z","dependencies_parsed_at":"2024-01-29T19:30:24.818Z","dependency_job_id":"a4dcbc47-5782-4843-92f0-b16d1f5f5902","html_url":"https://github.com/danni/uwebsockets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danni%2Fuwebsockets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danni%2Fuwebsockets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danni%2Fuwebsockets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danni%2Fuwebsockets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danni","download_url":"https://codeload.github.com/danni/uwebsockets/tar.gz/refs/heads/esp8266","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223489725,"owners_count":17153813,"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":[],"created_at":"2024-08-01T19:00:54.677Z","updated_at":"2025-10-24T09:45:05.818Z","avatar_url":"https://github.com/danni.png","language":"Python","readme":"# Micropython websockets (esp8266 implementation)\n\nAn implementation of websockets for the ESP8266 (client only ATM). This is a\nwork in progress, some of which might move into the modwebsocket C module\nthat's built into micropython, however that's incomplete, and the handshaking\nisn't standard-compliant.\n\nThere's no asyncio on the esp8266 (today) but I'd like to build something that\nlooks for all intents and purposes like a asyncio `Protocol` using the\nsocket receive handler it does have.\n\n## \"Screenshot\"\n\n```\n$ pip install adafruit-ampy\n$ ampy mkdir uwebsockets\n$ ampy put uwebsockets/protocol.py uwebsockets/protocol.py\n$ ampy put uwebsockets/client.py uwebsockets/client.py\n$ ampy run example/client.py\n\u003e esp8266 1.5.4(baaeaebb) v1.8.3-80-g1f61fe0-dirty on 2016-08-31 ESP module with ESP8266\n\u003c Hello esp8266 1.5.4(baaeaebb) v1.8.3-80-g1f61fe0-dirty on 2016-08-31 ESP module with ESP8266!\n```\n\n```\n$ pip install websockets\n$ python example/server.py\nConnection from ('192.168.1.11', 1883)\n\u003c esp8266 1.5.4(baaeaebb) v1.8.3-80-g1f61fe0-dirty on 2016-08-31 ESP module with ESP8266\n\u003e Hello esp8266 1.5.4(baaeaebb) v1.8.3-80-g1f61fe0-dirty on 2016-08-31 ESP module with ESP8266!\n```\n\n## Minimal example client against 'ws://echo.websocket.org/'\n\n\n```\n$ webrepl_client.py 192.168.3.1\nPassword: \n\nWebREPL connected\n\u003e\u003e\u003e \n\u003e\u003e\u003e \nMicroPython v1.9.4-272-g46091b8a on 2018-07-18; ESP module with ESP8266\nType \"help()\" for more information.\n\u003e\u003e\u003e import echo_websocket_org\nThe quick brown fox jumps over the lazy dog\n\n\u003e\u003e\u003e \n### closed ###\n$ \n$ cat echo_websocket_org.py \nimport uwebsockets.client\nwebsocket = uwebsockets.client.connect(\"ws://echo.websocket.org/\")\nmesg = \"The quick brown fox jumps over the lazy dog\"\nwebsocket.send(mesg + \"\\r\\n\")\nresp = websocket.recv()\nprint(resp)\nassert(mesg + \"\\r\\n\" == resp)\n$ \n```\n\n# Micropython Socket.io\n\nAn implementation of socket.io and engine.io for the ESP8266 (client only ATM).\nThis is a work in progress and has only been tested against Flask-SocketIO.\n\nThere's no asyncio on the esp8266 (today) but I'd like to build something that\nlooks for all intents and purposes like the socket.io web API. At the moment\nthis means its own event loop + lots of timeouts.\n\nAn interesting example client is\n[this OpsGenie bridge](https://github.com/danni/micropython-opsgenie-bridge/tree/master/uclient).\n\n## Compatibility\n\nYou might need to bake this code into your firmware to use it. You also need\nto bake in the `logging` module. Finally to run the `unix` port you need to\n[patch your micropython to support `socket.settimeout`](https://github.com/danni/micropython/tree/2379-unix-settimeout).\n","funding_links":[],"categories":["Networking","Libraries"],"sub_categories":["Communications"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanni%2Fuwebsockets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanni%2Fuwebsockets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanni%2Fuwebsockets/lists"}