{"id":20339045,"url":"https://github.com/szczyglis-dev/php-ultra-small-proxy","last_synced_at":"2025-10-05T07:59:15.155Z","repository":{"id":57675822,"uuid":"242619521","full_name":"szczyglis-dev/php-ultra-small-proxy","owner":"szczyglis-dev","description":"[PHP] Lightweight proxy with full support for sessions, cookies, POST/FORM submissions, and URL rewriting. The proxy offers two methods of URL rewriting: XML and Regex. It also includes features such as HTTP Auth, caching, and more.","archived":false,"fork":false,"pushed_at":"2024-08-26T04:25:00.000Z","size":58,"stargazers_count":17,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-18T16:35:57.230Z","etag":null,"topics":["cookies","crawler","crawler-php","css","http-client","http-proxy","networking","proxy","proxy-server","webbrowser","website","www"],"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/szczyglis-dev.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,"zenodo":null}},"created_at":"2020-02-24T01:14:36.000Z","updated_at":"2025-06-19T22:50:03.000Z","dependencies_parsed_at":"2025-04-11T23:12:58.222Z","dependency_job_id":"9a451db8-36bb-4ed9-9f17-17403eb6b4ab","html_url":"https://github.com/szczyglis-dev/php-ultra-small-proxy","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/szczyglis-dev/php-ultra-small-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szczyglis-dev%2Fphp-ultra-small-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szczyglis-dev%2Fphp-ultra-small-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szczyglis-dev%2Fphp-ultra-small-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szczyglis-dev%2Fphp-ultra-small-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/szczyglis-dev","download_url":"https://codeload.github.com/szczyglis-dev/php-ultra-small-proxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/szczyglis-dev%2Fphp-ultra-small-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278425490,"owners_count":25984687,"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-10-05T02:00:06.059Z","response_time":54,"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":["cookies","crawler","crawler-php","css","http-client","http-proxy","networking","proxy","proxy-server","webbrowser","website","www"],"created_at":"2024-11-14T21:15:14.220Z","updated_at":"2025-10-05T07:59:15.137Z","avatar_url":"https://github.com/szczyglis-dev.png","language":"PHP","funding_links":["https://www.buymeacoffee.com/szczyglis"],"categories":[],"sub_categories":[],"readme":"Release: **2.1.3** | build: **2024.08.26** | PHP: **^7.2.5|^8.0**\n\n# Ultra Small Proxy 2\n\n**Ultra Small Proxy is a lightweight proxy written in PHP.**\n\n## How to install\n```\ncomposer require szczyglis/php-ultra-small-proxy\n``` \n## Features\n- Proxy server written in PHP\n- Easy to use and integrate\n- Simple and lightweight\n- Sessions support\n- Supports sending and receiving cookies\n- Supports sending and receiving HTTP headers\n- Cache and asset storage\n- Domain and IP/host connection support\n- HTTP Basic Auth support\n- GET and POST request handling\n- Form submission support\n- POST variable redirection\n- Toolbar with address bar, configuration, and debugger\n- URLs rewritten/proxied at runtime (links, images, CSS, JavaScript, etc.)\n- Two different methods for URL rewriting: Regex (with preg_replace) and XML (with libxml/DOM)\n- Supports PHP 7.2.5+ and 8.0+\n\n## Requirements\n\n- PHP 7.2.5+ or 8.0+ with CURL and XML extensions\n- Composer - https://getcomposer.org/\n\n\n## Usage example\n```php\n\u003c?php\n// app.php\n\nrequire __DIR__ . '/vendor/autoload.php';\n\nuse Szczyglis\\UltraSmallProxy\\UltraSmallProxy;\nuse Szczyglis\\UltraSmallProxy\\Config;\n\n$config = new Config();\n\n$proxy = new UltraSmallProxy($config);\n\necho $proxy-\u003eload('https://github.com'); // \u003c-- specify start page here\n\n```\nEnsure you have write permissions to the `./cookies` and `./cache` directories.\n\n### WARNING: The cookies directory should not be publicly accessible!\n\n## Screenshot\n\n![proxy](https://user-images.githubusercontent.com/61396542/155353063-fde84995-6e43-46c4-8a1c-b8b4772e6dfc.png)\n\n\nOpen `loopback.php` if you want to test proxy features such as session support, POST variable redirection, form submission, and more, e.g.:\n```php\n\u003c?php\n\n$output = $proxy-\u003eload('http://localhost/loopback.php'); \n```\n\n## Repository contents:\n\n- `src/` - proxy classes\n\n- `index.php` - usage example\n\n- `loopback.php` - loopback for testing features like session support, form variable sending, and cookie redirection\n\n\n## Basic usage\n\n```php\n\nuse Szczyglis\\UltraSmallProxy\\UltraSmallProxy;\nuse Szczyglis\\UltraSmallProxy\\Config;\n\n$config = new Config();\n$proxy = new UltraSmallProxy($config);\n\necho $proxy-\u003eload('https://github.com');\n```\n\n## Configuration\n\n```php\n$output = $proxy-\u003eload('https://github.com', $force = false); \n```\nBoolean `$force` - if set to `false`, URLs given in the QUERY STRING will always overwrite URLs passed here. Set to `true` to reverse this behavior. Default: `false`.\n\n\n## Config values:\n\nBefore page load:\n\n**$config-\u003eset('init', true)** - `boolean`, auto-init `true|false`, default: `true`\n\n**$config-\u003eset('source', 'domain')** - `string`, input source `domain|ip`, default: `domain`\n\n**$config-\u003eset('raw', false)** - `boolean`, raw download `true|false`, default: `false`\n\n**$config-\u003eset('toolbar', true)** - `boolean`, attach toolbar  `true|false`, default: `true`\n\n**$config-\u003eset('user_agent', 'Mozilla/4.0 (compatible;)')** - `string`, user agent, default: `Mozilla/4.0 (compatible;)`\n\n**$config-\u003eset('timeout', 120)** - `int`, curl timeout, default: `120`\n\n**$config-\u003eset('max_redirects', 10)** - `int`, curl max redirects, default: `10`\n\n**$config-\u003eset('cookies_dir', './cookies')** - `string`, cookies directory, default: `./cookies`\n\n**$config-\u003eset('cache_dir', './cache')** - `string`, cache directory, default: `./cache`\n\n**$config-\u003eset('method', 'GET')** - `string`, request method `GET|POST`\n\n**$config-\u003eset('rewrite', 'REGEX2')** - `string`, rewrite method `REGEX,REGEX2,REGEX3,DOM`, default: `REGEX2`\n\n**$config-\u003eset('rewrite_url', true)** - `boolean`, enable URL rewriting `true|false`, default: `true`\n\n**$config-\u003eset('rewrite_img', true)** - `boolean`, enable IMG rewriting `true|false`, default: `true`\n\n**$config-\u003eset('rewrite_js', true)** - `boolean`, enable JS rewriting `true|false`, default: `true`\n\n**$config-\u003eset('rewrite_form', true)** - `boolean`, enable FORM ACTION rewriting `true|false`, default: `true`\n\n**$config-\u003eset('rewrite_css', true)** - `boolean`, enable CSS rewriting `true|false`, default: `true`\n\n**$config-\u003eset('rewrite_video', true)** - `boolean`, enable VIDEO rewriting `true|false`, default: `true`\n\n**$config-\u003eset('rewrite_ip', true)** - `boolean`, enable domain to IP+Host resolve `true|false`, default: `true`\n\n**$config-\u003eset('assets', 'REDIRECT')** - `string`, assets proxying mode `REDIRECT|CURL`, default: `REDIRECT`\n\n**$config-\u003eset('is_cfg', false)** - `boolean`, show options `true|false`, default: `false`\n\n**$config-\u003eset('is_dbg', false)** - `boolean`, show debug `true|false`, default: `false`\n\n**$config-\u003eset('htaccess_user', 'user')** - `string`, HTTP AUTH user\n\n**$config-\u003eset('htaccess_pass', 'pass')** - `string`, HTTP AUTH password\n\n\n## Public methods\n\nAfter page load:\n\n**$siteCookies = $proxy-\u003ecookie-\u003egetSiteCookies()** - returns cookies[] received from proxied site\n\n**$localCookies = $proxy-\u003ecookie-\u003egetLocalCookies()** - returns cookies[] stored localy and sended to proxied site\n\n**$status = $proxy-\u003ehttp-\u003egetStatus()** - returns connection status[]\n\n**$headers = $proxy-\u003ehttp-\u003egetHeaders()** - returns received headers[]\n\n**$sid = $proxy-\u003egetSid()** - returns proxied PHPSESSID if exists\n\n**$errors = $proxy-\u003egetErrors()** - returns error messages[] if occured\n\n \nOther methods:\n\n**$parsed = $proxy-\u003erender($html)** - parses/rewrites URLs in custom HTML content with the selected `$rewriteMode`.\n\n---\n\n### Changelog \n\n`2.1.0` -- Package was added to Packagist (2022-04-23)\n\n`2.1.1` -- Updated PHPDoc (2022-04-25)\n\n`2.1.2` -- Updated composer.json (2022-04-28)\n\n`2.1.3` -- improved documentation (2024-08-26)\n\n--- \n**Ultra Small Proxy is free to use, but if you like it, you can support my work by buying me a coffee ;)**\n\nhttps://www.buymeacoffee.com/szczyglis\n\n**Enjoy!**\n\nMIT License | 2022 Marcin 'szczyglis' Szczygliński\n\nhttps://github.com/szczyglis-dev/php-ultra-small-proxy\n\nhttps://szczyglis.dev\n\nContact: szczyglis@protonmail.com\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszczyglis-dev%2Fphp-ultra-small-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fszczyglis-dev%2Fphp-ultra-small-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fszczyglis-dev%2Fphp-ultra-small-proxy/lists"}