question

Upvotes
Accepted
401 21 25 35

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 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Upvotes
Accepted
488 16 20 29

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 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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