How to make a proxy server using php script?

Let's say I have vps hosting with a dedicated ip, I can make a curl php script that gets the URL, extracts it and displays it, and makes it all a proxy server, so I can put my vps ip in the proxy settings browser server.

Is there any way to do this?

Note. Please do not offer me a web proxy, such as glype.

thank

+5
source share
5 answers

Yes, you could (see Jasper's answer). This will effectively create your own web proxy.

However, given that this is a VPS, I would suggest using the SSH SOCKS proxy, as it will be easier and will go through an encrypted tunnel to the VPS.

+1

Apache mod_proxy mod_proxy_http. . docs.

- https, VPS.

+1

tor proxy, script:

<?php
function tor_new_identity($tor_ip='127.0.0.1', $control_port='9051',$auth_code='saad'){
$fp = fsockopen($tor_ip, $control_port, $errno, $errstr, 30);
if (!$fp) return false; //can't connect to the control port

fputs($fp, "AUTHENTICATE $auth_code\r\n");
$response = fread($fp, 1024);
list($code, $text) = explode(' ', $response, 2);
if ($code != '250') return false; //authentication failed

//send the request to for new identity
fputs($fp, "signal NEWNYM\r\n");
$response = fread($fp, 1024);
list($code, $text) = explode(' ', $response, 2);
if ($code != '250') return false; //signal failed

fclose($fp);
return true;
}

?>

"if (tor_new_identity('127.0.0.01', '9051')) {//do stuffs here}" tor VPS 1st.

+1

, . PHP script, Glype. 4 - PHP.

  • GlypeProxy, PHP-. CURL.
  • , , . /.
  • php-proxy, , // .

, tcp . http- cURL .

SO, script.

Squid proxy Linux ( http://es.kioskea.net/faq/613-instalar-un-servidor-proxy-http-squid) Windows ( ), FreeProxy - . ( http://www.softpedia.com/get/Internet/Servers/Proxy-Servers/FreeProxy.shtml)

- VPN. VPN, , SSH, VPS. /VPS.

VPS IP "" VPS/Desktop . (, - , VPN)

+1

You can check out this PHP proxy that uses cURL . This is not ideal (I'm in the process of fixing it to handle PUT requests, applications / json POSTS, etc.). The fact is that you need to configure the web server to rewrite all requests to this file name so that you can proxy them correctly.

0
source

All Articles