I'm trying to send an XML request to IP:port, but cURL always times out. However, the endpoint is up and running. Am I specifying the URL wrong? This is what I have:
$ip = '90.179.113.54';
$port = '5500';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://' . $ip . ':' . $port);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 4);
curl_setopt($ch, CURLOPT_POSTFIELDS, $xml);
$result = curl_exec($ch);
The $xml
variable is just the XML I'm sending, so don't worry about that. The server on this port should return an XML response which I suppose I'm capturing in $result
. However, this connection always ends in a timeout - when I enter the IP/port into the browser, it doesn't time out. It returns an XML response which the browser is unable to process.
Telnet response:
telnet 90.179.113.54 5500
Trying 90.179.113.54...
Connected to 54.113.broadband12.iol.cz.
Escape character is '^]'.
telnet 90.179.113.54 5500
Trying 90.179.113.54...
Connected to 54.113.broadband12.iol.cz.
<?xml version="1.0" encoding="Windows-1250" standalone="yes"?>
<RESPONSE TYPE="0" MODUL="" LANG=""><ERROR ERRNUM="0" ERRMESSAGE="0-OK" ATTRIBUT=""/></RESPONSE>