These forums are locked and archived, but all topics have been migrated to the new forum. You can search for this topic on the new forum: Search for Connecting to server from a different IP using API on the new forum.
Hi,
I can communicate with the server using the following PHP script if the PHP script is executed from the server
$url = 'https://63.142.249.131:10000/virtual-server/remote.cgi?program=list-commands&json=1';
echo testconnection($url);
function testconnection($url) {
$ch = curl_init();
//curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_USERPWD, "root:pass");
curl_setopt ($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt ($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
$result = curl_exec ($ch);
curl_close ($ch);
return $result;
}
The exact same script, if it is executed from another webserver (with php curl installed), it doesn't connect.
Could anyone help me how to connect from a different server?
Thanks!