{"id":21842822,"url":"https://github.com/gonzofish/ws-chat-server","last_synced_at":"2025-03-21T16:15:20.312Z","repository":{"id":86062361,"uuid":"88808672","full_name":"gonzofish/ws-chat-server","owner":"gonzofish","description":"A small server for chatting through WebSockets","archived":false,"fork":false,"pushed_at":"2017-04-20T22:30:07.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-26T11:28:05.004Z","etag":null,"topics":["chat","eventmachine","ruby","toy","toy-project","websocket","websockets"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/gonzofish.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":"2017-04-20T01:48:31.000Z","updated_at":"2017-04-20T02:02:16.000Z","dependencies_parsed_at":null,"dependency_job_id":"1832b620-e04a-4eec-9c0c-3b5a55b89c03","html_url":"https://github.com/gonzofish/ws-chat-server","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/gonzofish%2Fws-chat-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonzofish%2Fws-chat-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonzofish%2Fws-chat-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gonzofish%2Fws-chat-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gonzofish","download_url":"https://codeload.github.com/gonzofish/ws-chat-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244825654,"owners_count":20516592,"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":["chat","eventmachine","ruby","toy","toy-project","websocket","websockets"],"created_at":"2024-11-27T22:13:15.922Z","updated_at":"2025-03-21T16:15:20.270Z","avatar_url":"https://github.com/gonzofish.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WebSocket Chat Server\n\nThis is just a toy chat server I wrote to get more comfortable/reacquainted with WebSockets!\n\n## Dependencies\n\nThe only dependency is the [EM-WebSocket library](https://github.com/igrigorik/em-websocket/).\nTo install it, just run:\n\n```shell\ngem install em-websocket\n```\n\n## Running the Server\n\nTo run the server:\n\n```shell\nruby em-ws.rb\n```\n\n## Message Format\n\nThe format for a message, both to and from the client, is:\n\n```typescript\n{\n    type: string;\n    username: string;\n    value?: any;\n}\n```\n\nAll messages require a `type` and `username`, but only some messages will\nprovide or require a `value`.\n\nTo see the types of messages the client can send, please see\n[Accepted Message Types](#client-types). For the types of messages the\nserver will send, please see [Response Types](#server-types).\n\n## \u003ca href=\"client-types\"\u003e\u003c/a\u003eAccepted Messages Types\n\nType|Purpose\n---|---\n`login`|Let's a user register their username, must be unique\n`logout`|Unregister the username\n`chat`|Send a chat message\n\nAll other types will result in a error message being returned.\n\n## \u003ca href=\"server-types\"\u003e\u003c/a\u003eResponses Types\n\nType|Purpose\n---|---\n`login_failure`|Username from a `login` is taken\n`logged_in`|Username successfully registered\n`chat`|A chat message was sent\n`error`|An unknown message type was sent\n\nAll users receive the `chat` messages, but only the sending user will\nreceive the other three message types.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgonzofish%2Fws-chat-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgonzofish%2Fws-chat-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgonzofish%2Fws-chat-server/lists"}