question

Upvotes
Accepted
401 15 18 33

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?

rkd-apirkdphp
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvotes
Accepted
488 12 13 27

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));

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea