{"id":19076493,"url":"https://github.com/tokaa1/wubsub","last_synced_at":"2026-01-21T09:33:38.152Z","repository":{"id":247824094,"uuid":"826914978","full_name":"tokaa1/wubsub","owner":"tokaa1","description":"A tiny ws:// RPC server using a JSON protocol.","archived":false,"fork":false,"pushed_at":"2024-08-16T19:51:50.000Z","size":36,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-08T07:01:43.203Z","etag":null,"topics":["go","ipc","melody","pubsub","rpc","websocket"],"latest_commit_sha":null,"homepage":"","language":"Go","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/tokaa1.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":"2024-07-10T16:26:18.000Z","updated_at":"2024-12-01T23:21:06.000Z","dependencies_parsed_at":"2024-07-10T21:25:22.895Z","dependency_job_id":"75c516e0-ae89-49b6-9780-2f429965beb6","html_url":"https://github.com/tokaa1/wubsub","commit_stats":null,"previous_names":["premiering/wubsub","tokaa1/wubsub"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tokaa1/wubsub","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokaa1%2Fwubsub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokaa1%2Fwubsub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokaa1%2Fwubsub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokaa1%2Fwubsub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tokaa1","download_url":"https://codeload.github.com/tokaa1/wubsub/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tokaa1%2Fwubsub/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274068335,"owners_count":25216892,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["go","ipc","melody","pubsub","rpc","websocket"],"created_at":"2024-11-09T01:59:32.712Z","updated_at":"2026-01-21T09:33:38.129Z","avatar_url":"https://github.com/tokaa1.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## wubsub\nwubsub is a simple RPC server built on top of websockets [using melody](https://github.com/olahol/melody) with a simple JSON protocol.\n\n## Features\n- 🤏 Small codebase for easy iteration and adaptation (currently ~400 lines)\n- 👂 Single-publisher Pub/Sub support\n- 🎆 Traditional RPC function calling (named `restpie` in wubsub)\n- 🔒 SSL support\n\n## Run the server\n```bash\ngo run .\n```\n\nWith TLS:\n```bash\ngo run . --tls --keyfile server.key --certfile server.cert\n```\n\nWith TLS and debug:\n```bash\ngo run . --tls --debug --keyfile server.key --certfile server.cert\n```\n\n## Protocol\nC-\u003eS indicates Client to Server.\n\nS-\u003eC indicates Server to Client.\n\n### General commands\n#### C-\u003eS Creating a channel\n```json\n{\n    \"type\": \"register\",\n    \"channel\": \"sample_channel\",\n    \"data\": {\n        \"name\": \"sample_channel\",\n        \"description\": \"Assistant chatting service\",\n        \"pubsub\": {\n            \"topics\": [\n                \"responses\"\n            ]\n        },\n        \"restpie\": {\n            \"methods\": [\n                \"status\",\n                \"get-opts\",\n                \"get-opts-schema\"\n            ]\n        }\n    }\n}\n```\n\n#### S-\u003eC Global, error is received from server due to receive client's action\n```json\n{\n    \"type\": \"error\",\n    \"data\": \"Tried to publish to channel you aren't a publisher for.\"\n}\n```\n\n### Pub/Sub commands\n#### C-\u003eS pubsub owner publishes data\n```json\n{\n    \"type\": \"ps-pub\",\n    \"channel\": \"sample_channel\",\n    \"topic\": \"responses\",\n    \"data\": {\n        \"text\": \"Why is the sky blue?\"\n    }\n}\n```\n\n#### C-\u003eS general user subscribes to pubsub\n```json\n{\n    \"type\": \"ps-sub\",\n    \"channel\": \"sample_channel\",\n    \"topic\": \"responses\"\n}\n```\n\n#### S-\u003eC general user receives data from topic they subscribed to\n```json\n{\n    \"type\": \"ps-recv\",\n    \"channel\": \"sample_channel\",\n    \"topic\": \"responses\",\n    \"data\": {\n        \"text\": \"Why is the sky blue?\"\n    }\n}\n```\n\n### restpie commands\nThe following restpie commands are shown with an example of the channel `sample_channel`, which has a restpie method/topic named `status`.\n\nGeneral user refers to the client that intiates the request.\n\nChannel owner is the owner of the `sample_channel` channel.\n#### C-\u003eS general user initiates request\n```json\n{\n    \"type\": \"pie-do\",\n    \"channel\": \"sample_channel\",\n    \"topic\": \"status\"\n}\n```\n\n#### S-\u003eC server confirms latest sent restpie request with ID with general user\nThis is done to ensure ordering and to know whom a packet should be sent to when receiving the response from the publisher of the restpie\n\n```json\n{\n    \"type\": \"pie-ack\",\n    \"channel\": \"ollama\",\n    \"topic\": \"status\",\n    \"reqid\": \"3642af4c-1bde-4dc8-9833-e4d2104c33f2\"\n}\n```\n\n#### S-\u003eC channel owner receives request\n```json\n{\n    \"type\": \"pie-req\",\n    \"channel\": \"sample_channel\",\n    \"topic\": \"status\",\n    \"reqid\": \"3642af4c-1bde-4dc8-9833-e4d2104c33f2\"\n}\n```\n\n#### C-\u003eS channel owner responds to the request\n```json\n{\n    \"type\": \"pie-resp\",\n    \"channel\": \"sample_channel\",\n    \"topic\": \"status\",\n    \"reqid\": \"3642af4c-1bde-4dc8-9833-e4d2104c33f2\",\n    \"data\": {\n        \"text\": \"Ok!\",\n        \"cpu_load\": \"5.2%\"\n    }\n}\n```\n\nServer will then receive this request and send the data to the general user\n\n#### S-\u003eC general user receives response from request\n```json\n{\n    \"type\": \"pie-recv\",\n    \"channel\": \"sample_channel\",\n    \"reqid\": \"3642af4c-1bde-4dc8-9833-e4d2104c33f2\",\n    \"topic\": \"status\",\n    \"data\": {\n        \"text\": \"Ok!\",\n        \"cpu_load\": \"5.2%\"\n    }\n}\n```\n\nThe request is then considered complete.\n\n## License\nUses the MIT license; do whatever you wish.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokaa1%2Fwubsub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftokaa1%2Fwubsub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftokaa1%2Fwubsub/lists"}