{"id":16999371,"url":"https://github.com/rtyler/meows","last_synced_at":"2025-03-22T07:50:47.750Z","repository":{"id":57638006,"uuid":"272147056","full_name":"rtyler/meows","owner":"rtyler","description":"Crate for handling websocket messages purrfectly","archived":false,"fork":false,"pushed_at":"2020-07-06T03:14:41.000Z","size":49,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-18T14:21:59.697Z","etag":null,"topics":["async","j","rust","websockets"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rtyler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-06-14T06:36:36.000Z","updated_at":"2020-07-06T03:14:43.000Z","dependencies_parsed_at":"2022-09-26T20:21:06.880Z","dependency_job_id":null,"html_url":"https://github.com/rtyler/meows","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/rtyler%2Fmeows","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtyler%2Fmeows/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtyler%2Fmeows/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rtyler%2Fmeows/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rtyler","download_url":"https://codeload.github.com/rtyler/meows/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244924766,"owners_count":20532874,"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":["async","j","rust","websockets"],"created_at":"2024-10-14T04:08:20.267Z","updated_at":"2025-03-22T07:50:47.728Z","avatar_url":"https://github.com/rtyler.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Message Exchange Over Web Sockets 🐈\n\nThis crate implements the simple pattern needed for implementing\nservice-to-service message exchange over WebSocket connections. Users of meows\ncan handle typed JSON message with the option for a default handler for any\nun-typed messages.\n\nMeows is built on top of [smol](https://github.com/stjepang/smol) for async\nwebsocket handling behavior. This makes Meows compatible with other smol-based\napplications, including those using\n[async-std](https://github.com/async-rs/async-std) 1.6.0 or later.\n\nAll messages intended to be handled must be wrapped in a meows appropriate\nenvelope described below:\n\n```json\n{\n    \"type\" : \"ping\",\n    \"value\" : {\n        \"msg\" : \"Hey kitty kitty\"\n    }\n}\n```\n\nWhich will then be mapped to a struct such as:\n\n```rust\n#[derive(Debug, Deserialize, Serialize)]\nstruct Ping {\n    msg: String,\n}\n```\n\nIn essence, anything that serde can deserialize, can be passed through meows.\n\n\n## Example\n\nThere are examples in the `examples/` directory, here's a simple message handler:\n\n```rust\nuse log::*;\nuse meows::*;\nuse smol;\n\nasync fn handle_ping(mut req: Request\u003c()\u003e) -\u003e Option\u003cMessage\u003e {\n    if let Some(ping) = req.from_value::\u003cPing\u003e() {\n        info!(\"Ping received with message: {}\", ping.msg);\n    }\n    Some(Message::text(\"pong\"))\n}\n\nfn main() -\u003e Result\u003c(), std::io::Error\u003e {\n    info!(\"Starting simple ping/pong websocket server with meows\");\n    let mut server = meows::Server::new();\n    server.on(\"ping\", handle_ping);\n\n    smol::run(async move {\n        server.serve(\"127.0.0.1:8105\".to_string()).await\n    })\n}\n```\n\n## Contributing\n\nMeows is a typical Rust project, e.g. `cargo build` and `cargo test` will do\nmost everything you would need to do.\n\nThere aren't nearly enough tests, helping with that would certainly be\nappreciated :)\n\n## Licensing\n\nThis crate is licensed as GPL-3.0+, which roughly means that if you're\npackaging up Meows and distributing a binary to an end-user, you must also make\nthe source of the Meows code available to that end-user. It is intentionally\n_not_ AGPL licensed, which means if you incorporate Meows into server-side code\nthat is never distributed to end-users, then you do not need to make the code\navailable to the service's users.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtyler%2Fmeows","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frtyler%2Fmeows","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frtyler%2Fmeows/lists"}