{"id":13525906,"url":"https://github.com/flaribbit/love2d-lua-websocket","last_synced_at":"2025-04-12T08:13:47.097Z","repository":{"id":62055467,"uuid":"338326437","full_name":"flaribbit/love2d-lua-websocket","owner":"flaribbit","description":"websocket client pure lua implement for love2d","archived":false,"fork":false,"pushed_at":"2021-11-02T02:06:05.000Z","size":48,"stargazers_count":43,"open_issues_count":2,"forks_count":11,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T08:13:39.703Z","etag":null,"topics":["client","love2d","lua","luajit","luasocket","websocket","websocket-client"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/flaribbit.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}},"created_at":"2021-02-12T13:26:19.000Z","updated_at":"2025-03-18T13:50:51.000Z","dependencies_parsed_at":"2022-10-25T20:01:33.867Z","dependency_job_id":null,"html_url":"https://github.com/flaribbit/love2d-lua-websocket","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaribbit%2Flove2d-lua-websocket","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaribbit%2Flove2d-lua-websocket/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaribbit%2Flove2d-lua-websocket/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flaribbit%2Flove2d-lua-websocket/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flaribbit","download_url":"https://codeload.github.com/flaribbit/love2d-lua-websocket/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248537144,"owners_count":21120711,"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":["client","love2d","lua","luajit","luasocket","websocket","websocket-client"],"created_at":"2024-08-01T06:01:23.377Z","updated_at":"2025-04-12T08:13:47.072Z","avatar_url":"https://github.com/flaribbit.png","language":"Lua","readme":"# websocket client pure lua implement for love2d\r\n\r\nEvent-driven websocket client for love2d in pure lua, which aims to be simple and easy to use.\r\n\r\nNot all websocket features are implemented, but it works fine. Tested with aiohttp(python) and ws(nodejs) library.\r\n\r\n## Quick start\r\nJust copy `websocket.lua` to your project directory, and write code as the following example.\r\n\r\n```lua\r\nlocal client = require(\"websocket\").new(\"127.0.0.1\", 5000)\r\nfunction client:onmessage(message)\r\n    print(message)\r\nend\r\nfunction client:onopen()\r\n    self:send(\"hello from love2d\")\r\n    self:close()\r\nend\r\nfunction client:onclose(code, reason)\r\n    print(\"closecode: \"..code..\", reason: \"..reason)\r\nend\r\n\r\nfunction love.update()\r\n    client:update()\r\nend\r\n```\r\n\r\n## WSS connection\r\nIf you need wss connection(websocket with TLS), you can use [LuaSec](https://github.com/brunoos/luasec) with this library, or just use [löve-ws](https://github.com/holywyvern/love-ws).\r\n\r\n## API\r\n* `websocket.new(host: string, port: int, path?: string) -\u003e client`\r\n* `function client:onopen()`\r\n* `function client:onmessage(message: string)`\r\n* `function client:onerror(error: string)`\r\n* `function client:onclose(code: int, reason: string)`\r\n* `client.status -\u003e int`\r\n* `client:send(message: string)`\r\n* `client:close(code?: int, reason?: string)`\r\n* `client:update()`\r\n","funding_links":[],"categories":["Networking","Lua"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaribbit%2Flove2d-lua-websocket","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflaribbit%2Flove2d-lua-websocket","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflaribbit%2Flove2d-lua-websocket/lists"}