apache - Php requests through proxy -
i have local apache server, , need pass requests php script (running on local server) through proxy. need set proxy apache/php.
how configure apache server proxy outgoing connections ?
well answer partly yes. php has socket opening functions, theoretically can defining own functions. php has introduced context parameter of functions external calls. example usage file_get_contents following:
$url = 'http://www'; $proxy = 'tcp://xxx:8080'; $context = array( 'http' => array( 'proxy' => $proxy, 'request_fulluri' => true, ), ); $context = stream_context_create($context); $body = file_get_contents($url, false, $context);
but cannot "something" make requests magically go through proxy. not entirely true well, have on layer. have possibility use vpn work great emulates network card. there utilities same socks proxies, heard hacks port through http proxies think rather unlikely work properly...
Comments
Post a Comment