{"id":42403840,"url":"https://github.com/endpot/php-rest-proxy","last_synced_at":"2026-01-28T01:28:31.380Z","repository":{"id":56977701,"uuid":"107787751","full_name":"endpot/php-rest-proxy","owner":"endpot","description":"A php rest proxy script based on guzzle","archived":false,"fork":false,"pushed_at":"2018-10-31T00:57:41.000Z","size":14,"stargazers_count":10,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-13T18:33:59.117Z","etag":null,"topics":["php","proxy","rest"],"latest_commit_sha":null,"homepage":"","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/endpot.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":"2017-10-21T14:37:11.000Z","updated_at":"2024-04-25T08:45:04.000Z","dependencies_parsed_at":"2022-08-21T11:50:29.979Z","dependency_job_id":null,"html_url":"https://github.com/endpot/php-rest-proxy","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/endpot/php-rest-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endpot%2Fphp-rest-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endpot%2Fphp-rest-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endpot%2Fphp-rest-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endpot%2Fphp-rest-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/endpot","download_url":"https://codeload.github.com/endpot/php-rest-proxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/endpot%2Fphp-rest-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28831394,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T23:29:49.665Z","status":"ssl_error","status_checked_at":"2026-01-27T23:25:58.379Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["php","proxy","rest"],"created_at":"2026-01-28T01:28:30.705Z","updated_at":"2026-01-28T01:28:31.375Z","avatar_url":"https://github.com/endpot.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-rest-proxy\n## About\nThis project is aimed to ultilize a rest proxy with php basing on Guzzle. Up to now, the script works fine for the most common request method (GET/POST/PUT/DELETE/OPTIONS). When data is submitted with POST method and contain multipart/form-data content, the script would create a new MultipartStream with global constant $_POST and $_FILES, and then transfer to target uri. The script also supports simple middleware within which you can deal with the request/response.\n## 关于\n该项目基于Guzzle实现请求的转发，包括但不限于GET/POST/PUT/DELETE/OPTIONS等方法。当请求方法为POST，且内容类型为multipart/form-data时，由于PHP的特性，从php://input中获取不到原始的数据，脚本会解析POST和FILES数组生成MultipartStream，再进行转发。该脚本还支持简单的中间件，分别作用于请求转发前后，对请求和响应进行处理。\n## Installation\nInstall using composer:\n```\ncomposer require endpot/php-rest-proxy\n```\n## Example\n```php\n// create proxy instance\n$proxy = new \\Proxy\\Proxy();\n\n// set target url\n$targetUrl = 'http://httpbin.org/';\n\n// create psr7 request based on the global parameters\n$request = $proxy-\u003efromGlobals();\n\n// add middlewares\n// forward request to target\n$response = $proxy-\u003eaddMiddleware('ExampleMiddleware')\n    -\u003eforward($request)\n    -\u003eto($targetUrl);\n    \n// get and show the response\necho $response-\u003egetBody();\n```\n## License\nIt is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendpot%2Fphp-rest-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fendpot%2Fphp-rest-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fendpot%2Fphp-rest-proxy/lists"}