{"id":19404298,"url":"https://github.com/hasithaishere/socket-io-redis-adapter-example","last_synced_at":"2025-04-14T07:50:41.628Z","repository":{"id":174565002,"uuid":"652404763","full_name":"hasithaishere/socket-io-redis-adapter-example","owner":"hasithaishere","description":":octocat: Example project for demonstrating horizontally scalability of Socket.io server with Redis Adapter ","archived":false,"fork":false,"pushed_at":"2024-10-11T03:27:01.000Z","size":27,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T21:23:20.184Z","etag":null,"topics":["javascript","nodejs","redis","redis-adapter","socket-io"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/hasithaishere.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2023-06-12T02:20:39.000Z","updated_at":"2024-05-19T01:59:18.000Z","dependencies_parsed_at":"2023-07-11T23:15:34.363Z","dependency_job_id":null,"html_url":"https://github.com/hasithaishere/socket-io-redis-adapter-example","commit_stats":null,"previous_names":["hasithaishere/socket-io-redis-adapter-example"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasithaishere%2Fsocket-io-redis-adapter-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasithaishere%2Fsocket-io-redis-adapter-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasithaishere%2Fsocket-io-redis-adapter-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasithaishere%2Fsocket-io-redis-adapter-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hasithaishere","download_url":"https://codeload.github.com/hasithaishere/socket-io-redis-adapter-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248844047,"owners_count":21170486,"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":["javascript","nodejs","redis","redis-adapter","socket-io"],"created_at":"2024-11-10T11:33:57.120Z","updated_at":"2025-04-14T07:50:41.603Z","avatar_url":"https://github.com/hasithaishere.png","language":"JavaScript","readme":"# Socket.io Redis Adapter Example\nExample project for demonstrating horizontally scalability of Socket.io server with Redis Adapter.\n\nPlease execute following commands to check the functionality. \n𝐇𝐚𝐩𝐩𝐲 𝐓𝐞𝐬𝐭𝐢𝐧𝐠 :robot:\n\n### Setup Redis Locally\n\nIf you haven't setup Redis locally, first you need to install Redis locally or need to run Redis as a container in your system. _Docker based setup is recommended._\n\n#### Setup Redis\nUse following command for run the Docker locally.\n```sh\ndocker run --name socket-adapter-redis -p 6379:6379 -d redis\n```\n\n#### Start Testing\nPlease execute following command to run the server. Server will start on port `3000`.\n```sh\nnode server.js 3000\n```\n\nFor testing purpose, you need to run secondary server on different port(ex - Port 3001).\n```sh\nnode server.js 3001\n```\n\nWhen you start the servers it will connect with the Redis and make the bridge between two socket servers.\n\nFor testing this functionality, please spin up following two clients using these commands.\n\n_Client 1_\n```sh\nnode client-1.js\n```\n\n_Client 2_\n```sh\nnode client-2.js\n```\n\nAfter the client starts publishing and receiving messages, you can observe that both clients receive all the messages from both servers. However, if these servers are disconnected and run individually, this scenario becomes infeasible. Therefore, it implies that both servers are bridged using a Redis adapter.\n\nFor more information please check following screen capture.\n\n![socket-adapter-test-full](https://github.com/hasithaishere/socket-io-redis-adapter-example/assets/4580975/22b99557-b593-40c0-b899-86b2739c8e7a)\n\n----\n\n#### Contributors\n- [Hasitha Gamage](https://hasitha.xyz)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasithaishere%2Fsocket-io-redis-adapter-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhasithaishere%2Fsocket-io-redis-adapter-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasithaishere%2Fsocket-io-redis-adapter-example/lists"}