{"id":13730901,"url":"https://github.com/neogeek/websocket-unity","last_synced_at":"2026-04-28T17:01:31.974Z","repository":{"id":46617591,"uuid":"289608976","full_name":"neogeek/websocket-unity","owner":"neogeek","description":"Simple wrapper for the websocket-csharp library.","archived":false,"fork":false,"pushed_at":"2021-10-04T15:03:22.000Z","size":392,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-25T18:04:57.815Z","etag":null,"topics":["unity","websocket"],"latest_commit_sha":null,"homepage":"","language":"C#","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/neogeek.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2020-08-23T03:31:52.000Z","updated_at":"2023-02-03T03:47:25.000Z","dependencies_parsed_at":"2022-07-22T01:48:08.260Z","dependency_job_id":null,"html_url":"https://github.com/neogeek/websocket-unity","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/neogeek/websocket-unity","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neogeek%2Fwebsocket-unity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neogeek%2Fwebsocket-unity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neogeek%2Fwebsocket-unity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neogeek%2Fwebsocket-unity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neogeek","download_url":"https://codeload.github.com/neogeek/websocket-unity/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neogeek%2Fwebsocket-unity/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32390067,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-28T14:34:11.604Z","status":"ssl_error","status_checked_at":"2026-04-28T14:32:37.009Z","response_time":56,"last_error":"SSL_read: 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":["unity","websocket"],"created_at":"2024-08-03T02:01:21.173Z","updated_at":"2026-04-28T17:01:31.939Z","avatar_url":"https://github.com/neogeek.png","language":"C#","funding_links":[],"categories":["C#"],"sub_categories":[],"readme":"# websocket-unity\n\n\u003e Simple wrapper for the websocket-csharp library.\n\n## Installation\n\n### Unity Package Manager\n\n\u003chttps://docs.unity3d.com/Packages/com.unity.package-manager-ui@2.0/manual/index.html\u003e\n\n#### Git\n\n```json\n{\n  \"dependencies\": {\n    \"com.neogeek.websocket-unity\": \"https://github.com/neogeek/websocket-unity.git#v2.0.0\",\n    ...\n  }\n}\n```\n\n## Usage\n\n### WebSocketController\n\nAdd the `WebSocketController` component to any GameObject.\n\n#### Properties\n\n- **URL** - The WebSocket URL, including the protocol (ws or wss) and the port.\n- **Log Events in Editor** - For debugging purposes only. Will only work in editor and in builds marked as development.\n- **Keep-Alive Timeout** - WebSockets timeout after around 60 seconds. This timeout is used to ping the server to maintain a connection.\n- **Message Handler** - Attach an event to this either via code or the inspector to receive messages from the WebSocket server.\n\n\u003cimg src=\"https://i.imgur.com/8POoQnB.png\" width=\"400\"\u003e\n\n### WebSocketJsonController\n\n`WebSocketJsonController` is similar to the base `WebSocketController` class, but this class also handles custom JSON responses from a WebSocket server.\n\n#### Example\n\n```csharp\nusing Newtonsoft.Json.Linq;\nusing UnityEngine;\nusing WebSocketUnity;\n\npublic struct Message\n{\n\n    public string type;\n\n    public string gameId;\n\n    public string gameCode;\n\n    public string playerId;\n\n}\n\npublic class WebSocketGameLobbyClient : MonoBehaviour\n{\n\n    [SerializeField]\n    private WebSocketJsonController _webSocketJsonController;\n\n    public void HandleMessage(JObject message)\n    {\n\n        Debug.Log(message[\"game\"]?[\"gameId\"]);\n\n    }\n\n    public void CreateGame()\n    {\n\n        _webSocketJsonController.Send(new Message { type = \"create\" });\n\n    }\n\n    public void JoinGame()\n    {\n\n        _webSocketJsonController.Send(new Message { type = \"join\" });\n\n    }\n\n}\n```\n\n\u003cimg src=\"https://i.imgur.com/YBfdwAX.png\" width=\"400\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneogeek%2Fwebsocket-unity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneogeek%2Fwebsocket-unity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneogeek%2Fwebsocket-unity/lists"}