Proxy server config for PHP

How may I set up a proxy server in PHP code for TRKD applications? Would I be able to set the proxy for a PHP SOAP individually?

Tagged:

Best Answer

  • Ripley79
    Answer ✓

    You can set up a proxy in PHP code with PHP/CURL library. Add the following code to application in order to pass the traffic through the proxy (the following examples assume your proxy's IP address is 127.0.0.1and port is 8888):


    curl_setopt($ch, CURLOPT_PROXY, '127.0.0.1:8888');

    Another way is to set the proxy for a PHP SOAP client individually:


    $client = new SoapClient($wsdl_url, array('soap_version' => SOAP_1_2, "proxy_host" => '127.0.0.1', "proxy_port" => 8888));