Writting a simple proxy in PHP

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I would like to forward on the server side (also called "proxy" or
"server-side redirect") some queries that get to my PHP script. A naive
approach is to do:

print(implode("", file("http://localhost:8090"; . $REQUEST_URI)));

Where http://localhost:8090 is the address I want to proxy to. But of
course, this only works for simple GET requests. It does not forward headers
(like Authentication), and won't work if the request is a POST.

Has anyone a suggestion on how I could implement a better proxy? I am not
looking for a perfect solution. Something that would forward headers and
handle posts would be good enough.

Alex
-- 
View this message in context: http://www.nabble.com/Writting-a-simple-proxy-in-PHP-tf3178331.html#a8819622
Sent from the PHP - General mailing list archive at Nabble.com.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux