{"id":22835229,"url":"https://github.com/jchristn/uscale","last_synced_at":"2025-08-10T20:31:27.899Z","repository":{"id":76080584,"uuid":"190266175","full_name":"jchristn/uscale","owner":"jchristn","description":"uscale - HTTP/HTTPS Loadbalancer in C#","archived":true,"fork":false,"pushed_at":"2024-01-17T07:42:20.000Z","size":250,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-26T19:48:27.539Z","etag":null,"topics":["http-server","https-server","loadbalancer","loadbalancing","proxy","scalability","scale","web","webscale"],"latest_commit_sha":null,"homepage":null,"language":"C#","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/jchristn.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,"governance":null}},"created_at":"2019-06-04T19:27:05.000Z","updated_at":"2024-12-21T22:04:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"8d0b246e-a8ba-4558-bbea-ea21e8a98e68","html_url":"https://github.com/jchristn/uscale","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jchristn/uscale","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristn%2Fuscale","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristn%2Fuscale/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristn%2Fuscale/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristn%2Fuscale/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jchristn","download_url":"https://codeload.github.com/jchristn/uscale/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jchristn%2Fuscale/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269783103,"owners_count":24475150,"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-08-10T02:00:08.965Z","response_time":71,"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":["http-server","https-server","loadbalancer","loadbalancing","proxy","scalability","scale","web","webscale"],"created_at":"2024-12-12T22:08:45.168Z","updated_at":"2025-08-10T20:31:27.411Z","avatar_url":"https://github.com/jchristn.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# uScale Loadbalancer\n```\n                           __\n    __  ________________ _/ /__ \n   / / / / ___/ ___/ __ `/ / _ \\\n  / /_/ (__  ) /__/ /_/ / /  __/\n  \\__,_/____/\\___/\\__,_/_/\\___/ \n\n```\n\nThe uScale loadbalancer is a simple high-availability loadbalancer written in C# using Watson and can be used with any HTTP/HTTPS application.\n\n![alt tag](https://github.com/jchristn/uscale/blob/master/assets/diagram_uscale.png)\n\n## Setup\n\nRun the app with ```setup``` in the command line arguments to run the setup script and create a ```system.json``` file.\n\n## Definitions\n\n- A 'Host' is defined as a virtual resource accessible by hostname as found in the HTTP request's ```Host``` header.  ```Hosts``` is an array, so you can have multiple managed virtual resources\n\n- A 'Node' is a physical resource mapped to a host by its hostname and port.  ```Nodes``` is an array, so you can have multiple nodes mapping to a host\n\n- Nodes are polled at an interval according to their configuration, and removed from rotation when the maximum number of failures are reached\n\n- Node polling continues while a node is failed to detect return-to-service conditions\n\n- The ```HeartbeatUrl``` for a Node must be a full URL including the protocol, i.e. http://10.1.1.1:80/loopback.  This URL must always return a 200 to indicate that the Node is online and available\n\n- The ```HandlingMode``` should either be ```Proxy``` or ```Redirect```:\n  - Proxy: uscale will submit a request on behalf of the requestor and marshal the response back to the requestor.  \n  - Redirect: uscale will send an HTTP redirect according to the configuration\n\n- The ```BalancingScheme``` should always be set to ```RoundRobin``` (for now)\n \n## Performance and Scale\n\nIt is recommended that you use ```Redirect``` for ```HandlingMode``` as this will unburden uscale from having to proxy each connection.\n\n## Sample Configuration\n\n```\n{\n  \"EnableConsole\": true,\n  \"RedirectStatusCode\": 302,\n  \"RedirectStatusString\": \"Moved Temporarily\",\n  \"Hosts\": [\n    {\n      \"Name\": \"MyApp\",\n      \"HttpHostNames\": [\n        \"www.myapp.com\",\n        \"myapp.com\"\n      ],\n      \"Nodes\": [\n        {\n          \"Hostname\": \"10.1.1.1\",\n          \"Port\": 80,\n          \"Ssl\": false,\n          \"HeartbeatUrl\": \"http://10.1.1.1:80/loopback\",\n          \"PollingIntervalMsec\": 2500,\n          \"MaxFailures\": 4,\n          \"Failed\": false\n        },\n        {\n          \"Hostname\": \"10.1.1.2\",\n          \"Port\": 80,\n          \"Ssl\": false,\n          \"HeartbeatUrl\": \"http://10.1.1.2:80/loopback\",\n          \"PollingIntervalMsec\": 2500,\n          \"MaxFailures\": 4,\n          \"Failed\": false\n        }\n      ],\n      \"LastIndex\": 0,\n      \"BalancingScheme\": \"RoundRobin\",\n      \"HandlingMode\": \"Redirect\",\n      \"AcceptInvalidCerts\": true\n    }\n  ],\n  \"Server\": {\n    \"DnsHostname\": \"+\",\n    \"Port\": 9000,\n    \"Ssl\": false\n  },\n  \"Auth\": {\n    \"AdminApiKeyHeader\": \"x-api-key\",\n    \"AdminApiKey\": \"admin\"\n  },\n  \"Logging\": {\n    \"SyslogServerIp\": \"127.0.0.1\",\n    \"SyslogServerPort\": 514,\n    \"MinimumSeverityLevel\": 1,\n    \"LogRequests\": false,\n    \"LogResponses\": false,\n    \"ConsoleLogging\": true\n  },\n  \"Rest\": {\n    \"UseWebProxy\": false,\n    \"WebProxyUrl\": \"\",\n    \"AcceptInvalidCerts\": true\n  }\n}\n\n```\n\n## Admin APIs\n\nUsing the admin API key, a set of RESTful APIs can be used to gather visibility into the loadbalancer during runtime.  The admin API key header defined in the ```Auth``` section of the config can be included as a header or as a querystring key-value pair.\n\n```\nGET /_loadbalancer/config?x-api-key=admin\nGET /_loadbalancer/connections?x-api-key=admin\nGET /_loadbalancer/hosts?x-api-key=admin\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchristn%2Fuscale","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjchristn%2Fuscale","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjchristn%2Fuscale/lists"}