php-proxy-app
php-proxy-app copied to clipboard
how to call php-proxy using other php code?
I have a running website and i need to use php-proxy to hide some part of that website.
I need to disable direct login to php-proxy main index page for every one.
I just need to call the proxy within my website only.
for example
if i have this link in my code
http://somedomain.com/file.zip
I need to call that file through the proxy like this
http://myproxydomain.com/index.php?q=mdan1aRvkmHb2K1mnNGnypzKY5efnpKrlpemmKE
I use option 3 for url method.
how to generate the encoded url for the orginal url on the fly for each user on the fly?
Thanks.
You could try changing the php-proxy script so it takes a variable as the search item, then send the request for the file to the php-script as a variable each time you need it. Obviously the proxy would have to be set to different URLs for each request, otherwise you would just have a static link.
I edit the index.php like this ` $encrypturl = $_GET['q']; $encrypturl = add_http($encrypturl); $encrypturl = htmlspecialchars_decode ($encrypturl); $base_url = ''; $base_url = add_http($base_url); $encrypturl = rel2abs($encrypturl, $base_url); $encrypturl = url_encrypt($encrypturl); // decode q parameter to get the real URL $url = url_decrypt($encrypturl);
$proxy = new Proxy(); `
Then i test it browsing this page
example.com/index.php?q=youtube.com
it redirect to example.com/index.php?q=mdan1aRvkmHd0KusqsSdkZPUomM
But it show index.php page with error (6) Could not resolve host: mdan1aRvkmHd0KusqsSdkZPUomM