Create a transparent HTTP proxy script in PHP

Is there a simple proxy / transparent php proxy script that I can host on my web server? These are my conditions:

  • I use free web hosting, so I have almost no control over my machine. Otherwise, I could use the HTTP :: Proxy Perl module. This means that the root password is missing. However, it launches php.

  • I already have a server running on port 80. I mean, I would like to put the php script as index.php on my server, which will forward all requests.

  • I don’t want a script like PHProxy or Glype where I go to the site, and then enter the URL. I want a server so that I can enter proxy.example.com:80 in Firefox or IE or any proxy settings, and it will redirect all requests to the server.

  • It is desirable (although not fatal if this is not possible), I would like it to pass the USER_AGENT environment variable (which is the browser) instead of setting itself to USER_AGENT

  • I can not start a new Daemon. My server will not allow this.

Is there a script that will do this? If so, then what?

+3
source share
1 answer

No, I'm sure this is not possible on shared hosting. This will not help your state number 3. It requires support at the web server level (for example, using Apache mod_proxy)

To do this, you will need to configure a remote server to be able to handle proxied requests. No reasonable web server will offer this feature.

+3
source

Source: https://habr.com/ru/post/1785803/


All Articles