├── .htaccess ├── README.md ├── image ├── download.png ├── github.png └── google.png ├── index.php └── proxy.php /.htaccess: -------------------------------------------------------------------------------- 1 | RewriteEngine On 2 | RewriteCond %{HTTPS} off 3 | RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 4 | 5 | RewriteCond %{REQUEST_URI} ^/proxy\.php$ [NC] 6 | RewriteRule ^ - [L] 7 | 8 | RewriteRule ^(.*)$ index.php [L] 9 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 9 | 10 | # There are still issues (github profile page duplicates, github search doesn't show content, github libraries don't show files, releases page doesn't show files...) 11 | 12 | # Reverse proxies for PHP 13 | 14 | ***Help you use other IP reverse proxy websites*** 15 | 16 | # Advantage 17 | 1. Can be quickly deployed on PHP hosts 18 | 2. You can modify the reverse proxy URL at any time 19 | 3. UserAgent can be modified at any time 20 | 4. Proxy for all resources on the page (e.g., CSS, JavaScript, images) 21 | 22 | # Screenshots 23 | 24 | ![github|690x371](https://github.com/xxecy-114514/php-proxy/blob/main/image/github.png?raw=true) 25 | 26 | ![download|690x371](https://github.com/xxecy-114514/php-proxy/blob/main/image/download.png?raw=true) 27 | 28 | ![google|690x371](https://github.com/xxecy-114514/php-proxy/blob/main/image/google.png?raw=true) 29 | 30 | # Operating environment 31 | 32 | Working on apache-php8.2 33 | 34 | Please change the reverse proxy url in index.php 35 | 36 | Not supported on subdirectories 37 | 38 | All parameters can be supported (https://example.com/example?example=example) 39 | 40 | -------------------------------------------------------------------------------- /image/download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xxecy-114514/php-proxy/54439cd897d69cf88bef44bae585d3a13d2ecc75/image/download.png -------------------------------------------------------------------------------- /image/github.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xxecy-114514/php-proxy/54439cd897d69cf88bef44bae585d3a13d2ecc75/image/github.png -------------------------------------------------------------------------------- /image/google.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/xxecy-114514/php-proxy/54439cd897d69cf88bef44bae585d3a13d2ecc75/image/google.png -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | loadHTML($result); 53 | 54 | // 查找并替换所有资源链接 55 | foreach (['img', 'script', 'link'] as $tag) { 56 | $elements = $dom->getElementsByTagName($tag); 57 | foreach ($elements as $element) { 58 | $attr = $tag === 'link' ? 'href' : 'src'; 59 | if ($element->hasAttribute($attr)) { 60 | $url = $element->getAttribute($attr); 61 | $absoluteUrl = getAbsoluteUrl($url1, $url); 62 | $element->setAttribute($attr, '/proxy.php?url=' . urlencode($absoluteUrl)); 63 | } 64 | } 65 | } 66 | 67 | echo $dom->saveHTML(); 68 | } else { 69 | echo $result; 70 | } 71 | } 72 | 73 | curl_close($ch); 74 | ?> 75 | -------------------------------------------------------------------------------- /proxy.php: -------------------------------------------------------------------------------- 1 |