{"id":18810605,"url":"https://github.com/php-http/random-host-plugin","last_synced_at":"2026-01-10T22:30:15.288Z","repository":{"id":43690610,"uuid":"461790234","full_name":"php-http/random-host-plugin","owner":"php-http","description":"Client-side round robin load balancer plugin for HTTPlug ","archived":false,"fork":false,"pushed_at":"2022-02-23T17:36:50.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-02-15T05:53:09.163Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","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/php-http.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}},"created_at":"2022-02-21T09:29:37.000Z","updated_at":"2023-11-12T02:41:40.000Z","dependencies_parsed_at":"2022-08-24T00:50:50.789Z","dependency_job_id":null,"html_url":"https://github.com/php-http/random-host-plugin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-http%2Frandom-host-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-http%2Frandom-host-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-http%2Frandom-host-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-http%2Frandom-host-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-http","download_url":"https://codeload.github.com/php-http/random-host-plugin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239748254,"owners_count":19690232,"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":[],"created_at":"2024-11-07T23:21:21.345Z","updated_at":"2026-01-10T22:30:15.232Z","avatar_url":"https://github.com/php-http.png","language":"PHP","readme":"#  Random Host Plugin\n\nYou might have found yourself in strange situation where instead of people using load balancer,\nthey supply you list of hosts you should try to call. They also don't like it when you pick one of them\nand use that, instead of going through trouble of doing distribution on client side.\n\nIf you want to go through this trouble, you can use this HTTPlug plugin.\nIt picks one of the hosts randomly at beginning and then keeps using it (sticky session), until there is a server\nor network error - in that case host that's being used is swapped for something else from the list.\nThis ensures same host is never used twice in a row in case you use some retry mechanism.\n\n## Install\n\nVia [Composer](https://getcomposer.org/doc/00-intro.md)\n\n```bash\ncomposer require php-http/random-host-plugin\n```\n## Usage\n\n```php\nnew \\Http\\Client\\Common\\Plugin\\SetRandomHostPlugin(\n    $psr17Factory,\n    ['hosts' =\u003e ['https://host1.example','https://host2.example']],\n);\n```\n\n## Licensing\n\nMIT license. Please see [License File](LICENSE) for more information.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-http%2Frandom-host-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-http%2Frandom-host-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-http%2Frandom-host-plugin/lists"}