I have local apache server, and I need to pass all requests from php script (running on my local server) through a proxy. So I need to set a proxy to apache/php.
How to configure an apache server to proxy for all outgoing connections ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
well the answer is partly yes.
php has socket opening functions, so you theoretically can do everything by defining your own functions. but php has introduced the context parameter into most of the functions that do external calls.
an example usage for file_get_contents would be the following:
but you cannot do “something” to make all your requests magically go through a proxy.
well this is not entirely true as well, but you have to do it on another layer.
you have the possibility to use a VPN which will work great as it emulates a network card.
there are also utilities to do the same for socks proxies, i also heard for some hacks to port something through http proxies but i think its rather unlikely that they work properly…