{"id":18103263,"url":"https://github.com/averagemarcus/espruino-websocket","last_synced_at":"2025-09-12T03:06:39.999Z","repository":{"id":67321567,"uuid":"68638270","full_name":"AverageMarcus/espruino-websocket","owner":"AverageMarcus","description":"Crude websocket implementation for use on an Espruino","archived":false,"fork":false,"pushed_at":"2016-09-21T07:56:05.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T11:24:29.795Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AverageMarcus.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2016-09-19T19:20:25.000Z","updated_at":"2016-09-20T08:14:17.000Z","dependencies_parsed_at":"2023-02-21T02:31:32.131Z","dependency_job_id":null,"html_url":"https://github.com/AverageMarcus/espruino-websocket","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/AverageMarcus%2Fespruino-websocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AverageMarcus%2Fespruino-websocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AverageMarcus%2Fespruino-websocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AverageMarcus%2Fespruino-websocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AverageMarcus","download_url":"https://codeload.github.com/AverageMarcus/espruino-websocket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247441007,"owners_count":20939235,"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-10-31T22:11:12.604Z","updated_at":"2025-04-06T05:43:38.816Z","avatar_url":"https://github.com/AverageMarcus.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# :warning: Now available in the Espruino repo - please use that instead\n\n---\n\n## :skull: _Deprecated_\n\n# espruino-websocket\nWebsocket implementation for use on an [Espruino](http://www.espruino.com/)\n\n## About\n\nA modified version of the current Espruino websocket module (https://github.com/espruino/EspruinoDocs/blob/master/modules/ws.js) hosted here until these changes are accepted into the main repo.\n\n## Improvements\n* Correctly handles connection upgrade without closing connection\n* Allows sending messages longer than 127 chars\n* Correctly generated a random Sec-WebSocket-Key\n* Adds ability for connecting to a websocket on a subdirectory by passing in the path\n* Added function to close websocket\n* Handle packets that contain multiple frames\n\n## How to use\n\n```js\nvar WebSocket = require(\"https://github.com/AverageMarcus/espruino-websocket/blob/master/websocket.js\");\nvar wifi = require(\"EspruinoWiFi\");\n\nfunction onInit() {\n  wifi.connect(WIFI_NAME, WIFI_OPTIONS, function(err) {\n    if (err) {\n      return console.log(\"Connection error: \"+err);\n    }\n\n    console.log(\"Connected to WiFi!\");\n\n    var ws = new WebSocket('echo.websocket.org');\n\n    ws.on('open', function(msg) {\n      console.log('Connected', msg);\n      ws.send('Hello WebSocket!');\n    });\n\n    ws.on('message', function(msg) {\n      console.log('Message', msg);\n    });\n  });\n}\n\nonInit();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faveragemarcus%2Fespruino-websocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faveragemarcus%2Fespruino-websocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faveragemarcus%2Fespruino-websocket/lists"}