{"id":17216481,"url":"https://github.com/ganeshkbhat/loadbalancer","last_synced_at":"2026-04-19T14:36:59.348Z","repository":{"id":162976875,"uuid":"637174966","full_name":"ganeshkbhat/loadbalancer","owner":"ganeshkbhat","description":"A simple threaded and clustered load balancer for nodejs with different forwarding algorithms and server request handling options","archived":false,"fork":false,"pushed_at":"2023-08-25T14:16:34.000Z","size":362,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-29T11:59:35.834Z","etag":null,"topics":["clustering","clustering-algorithm","loadbalancer","nodejs","threading"],"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/ganeshkbhat.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-05-06T18:33:10.000Z","updated_at":"2024-08-21T03:58:38.000Z","dependencies_parsed_at":null,"dependency_job_id":"327b7bf3-2ef5-4229-8565-ebba035c44e1","html_url":"https://github.com/ganeshkbhat/loadbalancer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ganeshkbhat/loadbalancer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshkbhat%2Floadbalancer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshkbhat%2Floadbalancer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshkbhat%2Floadbalancer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshkbhat%2Floadbalancer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ganeshkbhat","download_url":"https://codeload.github.com/ganeshkbhat/loadbalancer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganeshkbhat%2Floadbalancer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32010105,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"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":["clustering","clustering-algorithm","loadbalancer","nodejs","threading"],"created_at":"2024-10-15T03:27:50.986Z","updated_at":"2026-04-19T14:36:59.318Z","avatar_url":"https://github.com/ganeshkbhat.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# loadbalancer\n\nA simple threaded and clustered load balancer for nodejs with different forwarding algorithms and server request handling options. \n\n\n## DEMOS\n\nFind the demos in the [demo folder](https://github.com/ganeshkbhat/loadbalancer/tree/main/demos)\n\n\n## FEATURES\n\nThe following features are inbuilt into the loadbalancer:\n- [] Main Features \n    - [] Multi Processing and Multi Threading with Algorithm based routing\n    - [] Detailed Support based on development\n- [] Loadbalanced Server (Multi Protocol Support)\n- [] Loadbalanced Client (Multi Protocol Support)\n\n\n## .loadbalancer module\n\nThere are six modules in the loadbalancer module: `loadbalancer`, `clustering`, `processingMultiple`, `processing`, `threadingMultiple`, `threading`\n\n\n## .loadbalancer module\n\n`.loadbalancer`\n\n```\nvar loadbalancer = require(\"loadbalancerjs\").loadbalancer;\nvar httpSocketServer = require(\"loadbalancerjs\").sockets.httpSocketServer;\nvar server = require(\"./express-app\");\n\nloadbalancer({\n    \"server\": server,\n    \"protocol\": \"http\",\n    \"createCerts\": true,\n    \"host\": \"localhost\",\n    \"proxy\": {\n        \"proxy\": true,\n        \"protocol\": \"http\",\n        \"host\": \"localhost\",\n        \"port\": 7000,\n        \"proxyHost\": \"\",\n        \"proxyPort\": 9000\n    },\n    \"certs\": {\n        \"key\": \"./certs/ssl.key\",\n        \"cert\": \"./certs/ssl.cert\"\n    },\n    \"port\": 8000,\n    \"ws\": true,\n    \"processes\": 5,\n    \"threads\": 10,\n    \"mainProcessCallback\": () =\u003e { },\n    \"forkCallback\": (opts, pr) =\u003e {\n        // console.log(opts, pr);\n        // console.log(opts);\n        httpSocketServer(opts);\n    },\n    \"callbacks\": {\n        \"wsOnData\": null,\n        \"wsOnEnd\": null,\n        \"wsUpgrade\": null,\n        \"server\": null,\n        \"listen\": null\n    }\n})\n```\n\n\n## .loadbalancer cluster module\n\n\n`.cluster`\n\n```\n\nvar cluster = require(\"loadbalancerjs\").cluster;\nvar httpSocketServer = require(\"loadbalancerjs\").sockets.httpSocketServer;\nvar server = require(\"./express-app\");\n\ncluster({\n    \"server\": server,\n    \"protocol\": \"http\",\n    \"createCerts\": true,\n    \"host\": \"localhost\",\n    \"proxy\": {\n        \"proxy\": true,\n        \"protocol\": \"http\",\n        \"host\": \"localhost\",\n        \"port\": 7000,\n        \"proxyHost\": \"\",\n        \"proxyPort\": 9000\n    },\n    \"certs\": {\n        \"key\": \"./certs/ssl.key\",\n        \"cert\": \"./certs/ssl.cert\"\n    },\n    \"port\": 8000,\n    \"ws\": true,\n    \"processes\": 5,\n    \"threads\": 10,\n    \"mainProcessCallback\": () =\u003e { },\n    \"forkCallback\": (opts, pr) =\u003e {\n        // console.log(opts, pr);\n        // console.log(opts);\n        httpSocketServer(opts);\n    },\n    \"callbacks\": {\n        \"wsOnData\": null,\n        \"wsOnEnd\": null,\n        \"wsUpgrade\": null,\n        \"server\": null,\n        \"listen\": null\n    }\n})\n\n```\n\n\n## .loadbalancer processing module\n\n`.processing`\n\n```\nvar processing = require(\"loadbalancerjs\").processing;\nvar httpSocketServer = require(\"loadbalancerjs\").sockets.httpSocketServer;\nvar server = require(\"./express-app\");\n\nprocessing({\n    \"server\": server,\n    \"protocol\": \"http\",\n    \"createCerts\": true,\n    \"host\": \"localhost\",\n    \"proxy\": {\n        \"proxy\": true,\n        \"protocol\": \"http\",\n        \"host\": \"localhost\",\n        \"port\": 7000,\n        \"proxyHost\": \"\",\n        \"proxyPort\": 9000\n    },\n    \"certs\": {\n        \"key\": \"./certs/ssl.key\",\n        \"cert\": \"./certs/ssl.cert\"\n    },\n    \"port\": 8000,\n    \"ws\": true,\n    \"processes\": 5,\n    \"threads\": 10,\n    \"mainProcessCallback\": () =\u003e { },\n    \"forkCallback\": (opts, pr) =\u003e {\n        // console.log(opts, pr);\n        // console.log(opts);\n        httpSocketServer(opts);\n    },\n    \"callbacks\": {\n        \"wsOnData\": null,\n        \"wsOnEnd\": null,\n        \"wsUpgrade\": null,\n        \"server\": null,\n        \"listen\": null\n    }\n})\n```\n\n## .loadbalancer multi processing module\n\n`.processingMultiple`\n\n```\nvar processingMultiple = require(\"loadbalancerjs\").processingMultiple;\nvar httpSocketServer = require(\"loadbalancerjs\").sockets.httpSocketServer;\nvar server = require(\"./express-app\");\n\nprocessingMultiple({\n    \"server\": server,\n    \"protocol\": \"http\",\n    \"createCerts\": true,\n    \"host\": \"localhost\",\n    \"proxy\": {\n        \"proxy\": true,\n        \"protocol\": \"http\",\n        \"host\": \"localhost\",\n        \"port\": 7000,\n        \"proxyHost\": \"\",\n        \"proxyPort\": 9000\n    },\n    \"certs\": {\n        \"key\": \"./certs/ssl.key\",\n        \"cert\": \"./certs/ssl.cert\"\n    },\n    \"port\": 8000,\n    \"ws\": true,\n    \"processes\": 5,\n    \"threads\": 10,\n    \"mainProcessCallback\": () =\u003e { },\n    \"forkCallback\": (opts, pr) =\u003e {\n        // console.log(opts, pr);\n        // console.log(opts);\n        httpSocketServer(opts);\n    },\n    \"callbacks\": {\n        \"wsOnData\": null,\n        \"wsOnEnd\": null,\n        \"wsUpgrade\": null,\n        \"server\": null,\n        \"listen\": null\n    }\n})\n```\n\n## .loadbalancer threading module\n\n`.threading`\n\n```\nvar threading = require(\"loadbalancerjs\").threading;\nvar httpSocketServer = require(\"loadbalancerjs\").sockets.httpSocketServer;\nvar server = require(\"./express-app\");\n\nthreading({\n    \"server\": server,\n    \"protocol\": \"http\",\n    \"createCerts\": true,\n    \"host\": \"localhost\",\n    \"proxy\": {\n        \"proxy\": true,\n        \"protocol\": \"http\",\n        \"host\": \"localhost\",\n        \"port\": 7000,\n        \"proxyHost\": \"\",\n        \"proxyPort\": 9000\n    },\n    \"certs\": {\n        \"key\": \"./certs/ssl.key\",\n        \"cert\": \"./certs/ssl.cert\"\n    },\n    \"port\": 8000,\n    \"ws\": true,\n    \"processes\": 5,\n    \"threads\": 10,\n    \"mainProcessCallback\": () =\u003e { },\n    \"forkCallback\": (opts, pr) =\u003e {\n        // console.log(opts, pr);\n        // console.log(opts);\n        httpSocketServer(opts);\n    },\n    \"callbacks\": {\n        \"wsOnData\": null,\n        \"wsOnEnd\": null,\n        \"wsUpgrade\": null,\n        \"server\": null,\n        \"listen\": null\n    }\n})\n```\n\n\n## .loadbalancer multi threading module\n\n`threadingMultiple` or `threadPool`\n\n\n`.threadingMultiple`\n\n```\nvar threadingMultiple = require(\"loadbalancerjs\").threadingMultiple;\nvar httpSocketServer = require(\"loadbalancerjs\").sockets.httpSocketServer;\nvar server = require(\"./express-app\");\n\nthreadingMultiple({\n    \"server\": server,\n    \"protocol\": \"http\",\n    \"createCerts\": true,\n    \"host\": \"localhost\",\n    \"proxy\": {\n        \"proxy\": true,\n        \"protocol\": \"http\",\n        \"host\": \"localhost\",\n        \"port\": 7000,\n        \"proxyHost\": \"\",\n        \"proxyPort\": 9000\n    },\n    \"certs\": {\n        \"key\": \"./certs/ssl.key\",\n        \"cert\": \"./certs/ssl.cert\"\n    },\n    \"port\": 8000,\n    \"ws\": true,\n    \"processes\": 5,\n    \"threads\": 10,\n    \"mainProcessCallback\": () =\u003e { },\n    \"forkCallback\": (opts, pr) =\u003e {\n        // console.log(opts, pr);\n        // console.log(opts);\n        httpSocketServer(opts);\n    },\n    \"callbacks\": {\n        \"wsOnData\": null,\n        \"wsOnEnd\": null,\n        \"wsUpgrade\": null,\n        \"server\": null,\n        \"listen\": null\n    }\n})\n```\n\n`.threadPool`\n\n```\nvar threadPool = require(\"loadbalancerjs\").threadPool;\nvar httpSocketServer = require(\"loadbalancerjs\").sockets.httpSocketServer;\nvar server = require(\"./express-app\");\n\nthreadPool({\n    \"server\": server,\n    \"protocol\": \"http\",\n    \"createCerts\": true,\n    \"host\": \"localhost\",\n    \"proxy\": {\n        \"proxy\": true,\n        \"protocol\": \"http\",\n        \"host\": \"localhost\",\n        \"port\": 7000,\n        \"proxyHost\": \"\",\n        \"proxyPort\": 9000\n    },\n    \"certs\": {\n        \"key\": \"./certs/ssl.key\",\n        \"cert\": \"./certs/ssl.cert\"\n    },\n    \"port\": 8000,\n    \"ws\": true,\n    \"processes\": 5,\n    \"threads\": 10,\n    \"mainProcessCallback\": () =\u003e { },\n    \"forkCallback\": (opts, pr) =\u003e {\n        // console.log(opts, pr);\n        // console.log(opts);\n        httpSocketServer(opts);\n    },\n    \"callbacks\": {\n        \"wsOnData\": null,\n        \"wsOnEnd\": null,\n        \"wsUpgrade\": null,\n        \"server\": null,\n        \"listen\": null\n    }\n})\n```\n\n\n\n\u003c!-- \n## .serverutils module\n\nserver, reverseProxy, createNetProxy, websocket_secure, websocket, sqlKvStore --\u003e\n\n## .algorithms module\n\nThe following algorithms are supported: `randomize, sequential, sticky, weighted, singlemaxload`\n\n- `Randomize`, \n- `Sequential`, \n- `Sticky`, \n- `Weighted`, \n- `SingleMaxload`\n\n\n## .certificates module\n\nGenerate the Public and Private keys function: `generateCertificates`\n\n`generateCertificates()`\n\n## Architechure\n\n\n\n\u003c!--\n\nrequire(\"loadbalancer\") =\u003e process cluster =\u003e child worker thread =\u003e\n\n--\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganeshkbhat%2Floadbalancer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fganeshkbhat%2Floadbalancer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganeshkbhat%2Floadbalancer/lists"}