A lightweight, single-file PHP script to seamlessly route traffic between your browser and backend servers: ideal for remote development environments, flexible routing, and more.
-
Configure your web server
If necessary, adjust your web server configuration (e.g.,.htaccess) to forward all incoming requests toproxy.php.
Here's an example Apache configuration:RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule . proxy.php [L] -
Place the
proxy.phpfile
Copy theproxy.phpfile to your web server's document root directory. -
Customize the
$targetarray
Edit the$targetarray inproxy.phpto specify the target server's address and port:$target = [ 'scheme' => 'http', // Protocol (http or https) 'host' => 'your_backend_host', // Hostname or IP address 'port' => 8000, // Port number ];