{"id":21602275,"url":"https://github.com/b-goodman/redis-websocket-host","last_synced_at":"2026-04-18T06:02:12.525Z","repository":{"id":98729240,"uuid":"185728367","full_name":"b-goodman/redis-websocket-host","owner":"b-goodman","description":"Redis HTTP interface and websocket messaging Node.js server","archived":false,"fork":false,"pushed_at":"2019-05-09T04:54:07.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"public","last_synced_at":"2025-01-24T18:35:07.260Z","etag":null,"topics":["nodejs","redis","socket-io"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/b-goodman.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":"2019-05-09T04:51:51.000Z","updated_at":"2019-05-14T04:29:23.000Z","dependencies_parsed_at":"2023-05-25T01:00:09.226Z","dependency_job_id":null,"html_url":"https://github.com/b-goodman/redis-websocket-host","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/b-goodman%2Fredis-websocket-host","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-goodman%2Fredis-websocket-host/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-goodman%2Fredis-websocket-host/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/b-goodman%2Fredis-websocket-host/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/b-goodman","download_url":"https://codeload.github.com/b-goodman/redis-websocket-host/tar.gz/refs/heads/public","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244228350,"owners_count":20419396,"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":["nodejs","redis","socket-io"],"created_at":"2024-11-24T19:12:41.739Z","updated_at":"2026-04-18T06:02:07.408Z","avatar_url":"https://github.com/b-goodman.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redis Websocket Host\n\nA rudimentery websocket server which combines [socket.io](https://socket.io/docs/) with [redis](https://redis.io/commands) to form a redis HTTP interface, and realtime messenger.\n\nRequires an existing installation (see either [redis](https://redis.io/download) or [homebrew](https://formulae.brew.sh/formula/redis#default) )\n\n## Redis HTTP Interface\n\nAppend any redis-cli query to the base URL, seperated by back-slashes.\n\nE.g,\n\n### Show all keys\n\n```curl\nGET /keys/*\n\n{\"args\":[\"keys\",\"*\"],\"response\":[[\"search-cache\",\"latest_activity\",\"status\",\"anotherkey\"]]}\n```\n\n### Set a key `test` to value `hello`\n\n```curl\nGET /set/test/hello\n\n{\"args\":[\"set\",\"test\",\"hello\"],\"response\":[\"OK\"]}\n```\n\n### Query the value of `test`\n\n```curl\nGET /get/test\n\n{\"args\":[\"get\",\"test\"],\"response\":[\"hello\"]}\n```\n\n### Delete the key `test`\n\n```curl\nGET /del/test\n\n{\"args\":[\"del\",\"test\"],\"response\":[1]}\n```\n\n## Websocket Integration\n\nAny redis key modified via the HTTP API may also be listened to via a websocket inteface.\n\n### Node.js Client\n\n```javascript\n//The URL is the API base plus the key you want to listen to: redis-key-\u003ckey name\u003e\nconst url = '/redis-key-AN_EXAMPLE_KEY';\nvar socket = require('socket.io-client')(url);\n\nsocket.emit(\"new_client\", window.location.href);\nsocket.on(\"new_client\", (msg) =\u003e {\n    console.log(msg);\n});\n\n//an update to the key emits a \"local_redis_update\" event.\nsocket.on(\"local_redis_update\", (msg)=\u003e{\n    //Do something when a message comse through\n    console.log(msg);\n})\n```\n\n### Browser Client\n\n```javascript\n\nlet socket = null;\n$(function () {\n    socket = io('/redis-key-demonstrations_build_status');\n    socket.emit(\"new_client\", window.location.origin);\n    socket.on(\"new_client\", (msg) =\u003e {\n        console.log(msg)\n    });\n});\n\nsocket.on(\"local_redis_update\", (resp) =\u003e {\n    //Do something when a message comes through.\n    //For example, this updates a progress bar.\n    if(resp.key == jobTriggerID){\n        const print_response = (resp.p_max == resp.progress) ? `Complete.  Files saved to ${resp.msg}` : `${resp.msg} category ${resp.progress} of ${resp.p_max}`;\n        console.log(print_response);\n        setProgress( parseInt(resp.progress), parseInt(resp.p_max) );\n    }\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-goodman%2Fredis-websocket-host","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fb-goodman%2Fredis-websocket-host","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fb-goodman%2Fredis-websocket-host/lists"}