|
1 | 1 | # TinyProxy |
2 | 2 |
|
3 | | -tinyproxy is a lightweight PHP proxy service with caching for fetching and serving web resources. |
| 3 | +TinyProxy is a fast, secure, and modern PHP proxy service with advanced caching, SSRF protection, rate limiting, and a sleek web UI. |
4 | 4 |
|
5 | | -screenshots: |
6 | | - |
7 | | - |
8 | | - |
| 5 | +## Features |
9 | 6 |
|
| 7 | +- **High-performance caching:** File-based caching with automatic GZIP compression. |
| 8 | +- **Enterprise Security:** Built-in SSRF prevention, private IP blocking, and request rate limiting. |
| 9 | +- **Smart Modifications:** Automatic URL rewriting, ad blocking, and asset transformations on the fly. |
| 10 | +- **Admin Dashboard:** Built-in statistics, metrics, and cache management interface. |
| 11 | +- **Docker Ready:** Easy deployment using Docker and Docker Compose. |
10 | 12 |
|
11 | 13 | ## Installation |
12 | 14 |
|
13 | | -1. Clone this repository to your web server: |
| 15 | +### Using Docker (Recommended) |
14 | 16 |
|
| 17 | +1. Clone this repository: |
15 | 18 | ```sh |
16 | 19 | git clone https://github.com/bethropolis/tinyproxy.git |
17 | | - |
18 | 20 | cd tinyproxy |
19 | 21 | ``` |
20 | 22 |
|
21 | | -2. Install the required dependencies using Composer: |
| 23 | +2. Start the service using Docker Compose: |
| 24 | +```sh |
| 25 | +docker-compose up -d --build |
| 26 | +``` |
| 27 | +Your proxy will be available at `http://localhost:8080`. |
| 28 | + |
| 29 | +### Manual Installation (PHP 8.3+) |
22 | 30 |
|
| 31 | +1. Clone this repository: |
| 32 | +```sh |
| 33 | +git clone https://github.com/bethropolis/tinyproxy.git |
| 34 | +cd tinyproxy |
23 | 35 | ``` |
| 36 | + |
| 37 | +2. Install dependencies using Composer: |
| 38 | +```sh |
24 | 39 | composer install |
25 | 40 | ``` |
26 | | -3. Run the TinyProxy service: |
27 | | -``` |
28 | | -php -S localhost:8080 |
29 | | -``` |
30 | | -> I recommend using an `apache` server or `nginx` server. |
31 | 41 |
|
32 | | -using docker: |
33 | | -``` |
34 | | -docker build -t tinyproxy . |
35 | | -docker run -p 8080:80 --name tinyproxy-container tinyproxy |
| 42 | +3. Run the TinyProxy development server: |
| 43 | +```sh |
| 44 | +php -S localhost:8080 -t public |
36 | 45 | ``` |
37 | 46 |
|
| 47 | +> For production, it's recommended to point an Apache or Nginx virtual host directly to the `public/` directory. |
| 48 | +
|
38 | 49 | ## Usage |
39 | 50 |
|
40 | | -To use TinyProxy, simply make requests to the proxy URL with the `url` parameter: |
| 51 | +To use TinyProxy, simply visit the homepage or make requests to the proxy URL with the `url` parameter: |
41 | 52 |
|
42 | 53 | ``` |
43 | 54 | http://localhost:8080/?url=https://www.example.com |
44 | 55 | ``` |
45 | | -curl: |
| 56 | + |
| 57 | +Via cURL: |
46 | 58 | ```bash |
47 | | -$ curl http://localhost:8080/?url=https://www.example.com |
| 59 | +$ curl "http://localhost:8080/?url=https://www.example.com" |
48 | 60 | ``` |
49 | | -> replace `localhost:8080` with your web server's address. |
50 | 61 |
|
51 | | -#### parameters |
| 62 | +### Admin Dashboard |
52 | 63 |
|
53 | | -| parameter | description | type | |
54 | | -| --------- | ------------- |-------| |
55 | | -| `url` | The URL to proxy. |string | |
56 | | -| `cache` | The cache directory. |bool| |
| 64 | +You can monitor proxy performance, view statistics, and clear the cache by visiting the admin dashboard: |
| 65 | +``` |
| 66 | +http://localhost:8080/admin |
| 67 | +``` |
| 68 | + |
| 69 | +### Configuration |
57 | 70 |
|
| 71 | +TinyProxy uses a dot-notation configuration system. You can easily customize the application by creating a `.env` file in the project root: |
58 | 72 |
|
59 | | -> for more customization edit the `config.php` file. |
| 73 | +```env |
| 74 | +APP_ENV=production |
| 75 | +APP_DEBUG=false |
60 | 76 |
|
| 77 | +# Cache settings |
| 78 | +CACHE_ENABLED=true |
| 79 | +CACHE_DEFAULT_TTL=3600 |
| 80 | +
|
| 81 | +# Security |
| 82 | +SECURITY_BLOCK_PRIVATE_IPS=true |
| 83 | +SECURITY_RATE_LIMIT_ENABLED=true |
| 84 | +``` |
61 | 85 |
|
62 | 86 | ## Contributing |
63 | 87 |
|
64 | | -Contributions are welcome! If you find a bug or have an enhancement idea, please open an issue or submit a pull request. |
| 88 | +Contributions are welcome! If you find a bug or have an enhancement idea, please open an issue or submit a pull request. Ensure tests pass by running `vendor/bin/phpunit` before submitting. |
65 | 89 |
|
66 | 90 | ## License |
67 | 91 |
|
68 | 92 | TinyProxy is released under the MIT License. See [LICENSE](LICENSE) for details. |
69 | 93 |
|
70 | | - |
71 | | -Happy proxying! 💜 |
| 94 | +Happy proxying! |
0 commit comments