{"id":31844598,"url":"https://github.com/mohammadreza-73/phoxy","last_synced_at":"2025-10-12T07:32:29.348Z","repository":{"id":313232155,"uuid":"1050475078","full_name":"Mohammadreza-73/Phoxy","owner":"Mohammadreza-73","description":"Caching server that caches responses from other servers. ","archived":false,"fork":false,"pushed_at":"2025-09-26T18:17:24.000Z","size":46,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-26T20:29:17.428Z","etag":null,"topics":["cache","cache-proxy","file-cache","php-proxy-cache"],"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/Mohammadreza-73.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-04T13:37:13.000Z","updated_at":"2025-09-26T18:17:28.000Z","dependencies_parsed_at":"2025-09-26T20:29:43.418Z","dependency_job_id":"7cbb21ae-8b8e-440a-b5c7-83e1859ab81b","html_url":"https://github.com/Mohammadreza-73/Phoxy","commit_stats":null,"previous_names":["mohammadreza-73/caching-proxy-server","mohammadreza-73/phoxy"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/Mohammadreza-73/Phoxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohammadreza-73%2FPhoxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohammadreza-73%2FPhoxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohammadreza-73%2FPhoxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohammadreza-73%2FPhoxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mohammadreza-73","download_url":"https://codeload.github.com/Mohammadreza-73/Phoxy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mohammadreza-73%2FPhoxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279010662,"owners_count":26084784,"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-12T02:00:06.719Z","response_time":53,"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":["cache","cache-proxy","file-cache","php-proxy-cache"],"created_at":"2025-10-12T07:31:23.552Z","updated_at":"2025-10-12T07:32:29.335Z","avatar_url":"https://github.com/Mohammadreza-73.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PHP Proxy Server with Caching\n\nA lightweight, flexible PHP proxy server with intelligent caching capabilities for web content. Designed to improve website performance by caching HTML and JSON resources.\n\n\u003e [!IMPORTANT]  \n\u003e This proxy server is designed for development and moderate production use. For high-traffic applications, consider additional scaling strategies and monitoring.\n\n## Features\n\n- 🚀 High Performance: Caches responses to reduce server load and improve response times\n- 📦 Content-Type Aware: Intelligently caches HTML and JSON\n- ⚡ Configurable TTL: Different cache durations for different content types\n- 🔒 Security: Domain blacklisting and request validation\n- 📊 Cache Statistics: Built-in monitoring and statistics generation\n- 🛠️ Easy Configuration: Simple setup and customization\n\n## Supported Content Types\n\n| Content Type | Default TTL |        Description         |\n| ------------ | ----------- | -------------------------- |\n| HTML         |   1 Hour    | Web pages and HTML content |\n| JSON         |   1 Hour    | API responses and data     |\n\n## Installation and Running\n\n### 1. Clone the repository\n``` bash\ngit clone https://github.com/Mohammadreza-73/Caching-Proxy-Server.git\ncd Caching-Proxy-Server\n```\n\n### 2. Ensure PHP requirements\n``` bash\n# Check if cURL is enabled\nphp -m | grep curl\n```\n\n### 3. Ensure cache directory permissions\n``` bash\nchmod 755 cache/\nchmod 755 cache/*/\n```\n\n### 4. Serve server\n``` bash\nphp -S localhost:8000\n```\n\n## Configuration\n\nEdit `src/config/cache.php` to customize the proxy behavior:\n``` php\nreturn [\n    'ttl' =\u003e 3600, // Default cache Time to live\n    'timeout' =\u003e 30, // Request to cache content timeout\n    'max_content_length' =\u003e 10485760, // Max response size (10MB)\n\n    'filter_url_status' =\u003e true,  // Enable/Disable domain filter\n    'blacklist' =\u003e [  // Blacklisted domains\n        'blocked-domain1.com',\n        'blocked-domain2.com',\n    ],\n];\n```\n\n## Usage\n\n### Basic GET Request\n``` js\n// Frontend JavaScript usage\nfetch('/proxy.php?url=' + encodeURIComponent('https://example.com/api/data'))\n    .then(response =\u003e response.json())\n    .then(data =\u003e console.log(data));\n```\n\n### POST Request\n``` js\n// Sending POST data through proxy\nfetch('/proxy.php', {\n    method: 'POST',\n    headers: {\n        'Content-Type': 'application/json'\n    },\n    body: JSON.stringify({\n        url: 'https://api.example.com/submit',\n        data: { /* your payload */ }\n    })\n});\n```\n\n### API Reference\n\n#### Query Parameters\n| Parameter | Required |               Description             |\n| --------- | -------- | ------------------------------------- |\n| `url`     | Yes      | The target URL to proxy (URL encoded) |\n\n#### Response Headers\n|          Header               |                      Description                    |\n| ----------------------------- | --------------------------------------------------- |\n| `X-Proxy-Cache`               | `HIT` if served from cache, `MISS` if fetched fresh |\n| `Access-Control-Allow-Origin` | `*` (CORS enabled)                                  |\n\n## Security Considerations\n\n1. Domain Blacklisting: Block specific domains\n2. Content Length Limits: Prevents large file attacks\n3. Timeout Protection: Limits request duration\n4. CORS Headers: Proper cross-origin handling\n5. Header Filtering: Removes sensitive headers from responses\n\n## Example Use Cases\n\n - API Aggregation: Combine multiple APIs with caching\n - Content Mirroring: Cache external resources for faster access\n - Cross-Origin Requests: bypass CORS limitations for development\n - Performance Optimization: Reduce load times for external resources\n - Offline Development: Cache responses for development without internet\n\n## File Structure\n\n``` text\ncaching-proxy-server/\n├── cache/               # Cache storage directory\n├── logs/                # Store logs in `app.log`\n├── src/                 # Source directory\n│   ├── config/          # Cache configuration settings\n│   ├── helpers/         # Helper functions\n│   ├── FileCache.php    # Class to handle cache files\n│   └── ProxyServer.php  # Class to manage Proxy Server\n├── .editorconfig        # config for editors\n└── index.php            # Serve project\n```\n\n## Contributing\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## Support\n\n1. Check the issues page\n2. Create a new issue with detailed description\n\n## License\n\nThis project is licensed under the MIT License - see the [License File](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadreza-73%2Fphoxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmohammadreza-73%2Fphoxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmohammadreza-73%2Fphoxy/lists"}