{"id":24153570,"url":"https://github.com/php-guy55/ocx","last_synced_at":"2026-05-13T00:03:31.595Z","repository":{"id":270996413,"uuid":"912116031","full_name":"php-guy55/ocx","owner":"php-guy55","description":null,"archived":false,"fork":false,"pushed_at":"2025-01-04T16:42:53.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-08T21:33:27.259Z","etag":null,"topics":["aac","design","hardhat","lucene","mfcc","modern","notes","sessionstorage","socks5","system","torch","typeface","web","web-application","webapp"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/php-guy55.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":"2025-01-04T16:42:16.000Z","updated_at":"2025-01-05T15:08:10.000Z","dependencies_parsed_at":"2025-01-04T17:34:28.716Z","dependency_job_id":null,"html_url":"https://github.com/php-guy55/ocx","commit_stats":null,"previous_names":["php-guy55/ocx"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/php-guy55/ocx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-guy55%2Focx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-guy55%2Focx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-guy55%2Focx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-guy55%2Focx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/php-guy55","download_url":"https://codeload.github.com/php-guy55/ocx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/php-guy55%2Focx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32961786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-12T23:30:32.555Z","status":"ssl_error","status_checked_at":"2026-05-12T23:30:18.191Z","response_time":102,"last_error":"SSL_read: 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":["aac","design","hardhat","lucene","mfcc","modern","notes","sessionstorage","socks5","system","torch","typeface","web","web-application","webapp"],"created_at":"2025-01-12T11:32:08.806Z","updated_at":"2026-05-13T00:03:31.577Z","avatar_url":"https://github.com/php-guy55.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Freeweb PHP Proxy\n\nThis proxy script allows you to forward all HTTP/HTTPS requests to another server. Works for all common request types \nincluding GET, POST requests with files, PATCH and PUT requests. It has minimal set of requirements \n(PHP \u003e=5.6, libcurl, gzip) which are available even on the smallest free hostings and has its own simple authorization \nand cookie support.\n\n## How to use\n* Copy the [Proxy.php](Proxy.php) script to publicly-accessible folder of a PHP web server (the script is standalone and has no PHP dependencies)\n* Make a cURL request targeting this script\n* Add **Proxy-Auth** header with auth key [found here](https://github.com/zounar/php-proxy/blob/master/Proxy.php#L40)\n* Add **Proxy-Target-URL** header with URL to be requested by the proxy\n* (Optional) Add **Proxy-Debug** header for debug mode\n\nIn order to protect using proxy by unauthorized users, consider changing `Proxy-Auth` token in [proxy source file](https://github.com/zounar/php-proxy/blob/master/Proxy.php#L40) and in all your requests.\n\n## How to use (via composer)\nThis might be useful when you want to redirect requests coming into your app. \n\n* Run `composer require zounar/php-proxy`\n* Add `Proxy::run();` line to where you want to execute it (usually into a controller action)\n  * In this example, the script is in `AppController` - `actionProxy`:\n    ```\n    use Zounar\\PHPProxy\\Proxy;\n    \n    class AppController extends Controller {\n\n        public function actionProxy() {\n            Proxy::$AUTH_KEY = '\u003cyour-new-key\u003e';\n            // Do your custom logic before running proxy\n            $responseCode = Proxy::run();\n            // Do your custom logic after running proxy\n            // You can utilize HTTP response code returned from the run() method\n        }\n    }\n    ```\n* Make a cURL request to your web\n  * In the example, it would be `http://your-web.com/app/proxy`\n* Add **Proxy-Auth** header with auth key [found here](https://github.com/zounar/php-proxy/blob/master/Proxy.php#L40)\n* Add **Proxy-Target-URL** header with URL to be requested by the proxy\n* (Optional) Add **Proxy-Debug** header for debug mode\n\nIn order to protect using proxy by unauthorized users, consider changing `Proxy-Auth` token by calling\n`Proxy::$AUTH_KEY = '\u003cyour-new-key\u003e';` before `Proxy::run()`. Then change the token in all your requests.\n\n## Usage example\nFollowing example shows how to execute GET request to https://www.github.com. Proxy script is at http://www.foo.bar/Proxy.php. All proxy settings are kept default, the response is automatically echoed.\n\n```php\n$request = curl_init('http://www.foo.bar/Proxy.php');\n\ncurl_setopt($request, CURLOPT_HTTPHEADER, array(\n    'Proxy-Auth: Bj5pnZEX6DkcG6Nz6AjDUT1bvcGRVhRaXDuKDX9CjsEs2',\n    'Proxy-Target-URL: https://www.github.com'\n));\n\ncurl_exec($request);\n```\n\n## Debugging\nIn order to show some debug info from the proxy, add `Proxy-Debug: 1` header into the request. This will show debug info in plain-text containing request headers, response headers and response body.\n\n```php\n$request = curl_init('http://www.foo.bar/Proxy.php');\n\ncurl_setopt($request, CURLOPT_HTTPHEADER, array(\n    'Proxy-Auth: Bj5pnZEX6DkcG6Nz6AjDUT1bvcGRVhRaXDuKDX9CjsEs2',\n    'Proxy-Target-URL: https://www.github.com',\n    'Proxy-Debug: 1'\n));\n\ncurl_exec($request);\n```\n\n## Specifying User-Agent\nSome sites may return different content for different user agents. In such case add `User-Agent` header to cURL request, it will be automatically passed to the request for target site. In this case it's Firefox 70 for Ubuntu.\n\n```php\n$request = curl_init('http://www.foo.bar/Proxy.php');\n\ncurl_setopt($request, CURLOPT_HTTPHEADER, array(\n    'User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:70.0) Gecko/20100101 Firefox/70.0',\n    'Proxy-Auth: Bj5pnZEX6DkcG6Nz6AjDUT1bvcGRVhRaXDuKDX9CjsEs2',\n    'Proxy-Target-URL: https://www.github.com'\n));\n\ncurl_exec($request);\n```\n\n## Error 301 Moved permanently\nIt might occur that there's a redirection when calling the proxy (not the target site), eg. during `http -\u003e https` redirection. You can either modify/fix the proxy URL (which is recommended), or add `CURLOPT_FOLLOWLOCATION` option before `curl_exec`.\n\n```php\n$request = curl_init('http://www.foo.bar/Proxy.php');\n\ncurl_setopt($request, CURLOPT_FOLLOWLOCATION, true );\ncurl_setopt($request, CURLOPT_HTTPHEADER, array(\n    'Proxy-Auth: Bj5pnZEX6DkcG6Nz6AjDUT1bvcGRVhRaXDuKDX9CjsEs2',\n    'Proxy-Target-URL: https://www.github.com'\n));\n\ncurl_exec($request);\n```\n\n## Save response into variable\nThe default cURL behavior is to echo the response of `curl_exec`. In order to save response into variable, all you have to do is to add `CURLOPT_RETURNTRANSFER` cURL option.\n\n```php\n$request = curl_init('http://www.foo.bar/Proxy.php');\n\ncurl_setopt($request, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($request, CURLOPT_HTTPHEADER, array(\n    'Proxy-Auth: Bj5pnZEX6DkcG6Nz6AjDUT1bvcGRVhRaXDuKDX9CjsEs2',\n    'Proxy-Target-URL: https://www.github.com'\n));\n\n$response = curl_exec($request);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-guy55%2Focx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphp-guy55%2Focx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphp-guy55%2Focx/lists"}