php-proxy-app icon indicating copy to clipboard operation
php-proxy-app copied to clipboard

how to call php-proxy using other php code?

Open Medow opened this issue 6 years ago • 2 comments

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.

Medow avatar Oct 29 '18 13:10 Medow

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.

Benji-Collins avatar Oct 29 '18 21:10 Benji-Collins

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

Medow avatar Oct 30 '18 12:10 Medow