This is my url: http://xxx:5001/?messageId=2&baseId=1
If I open it in browser, work fine.
But if I open it with curl, I get error:
php curl Failed to connect to xxx port 5001: Connection refused
My php code:
$ch = curl_init();
curl_setopt($ch,CURLOPT_URL,'http://xxx:5001/?messageId=2&baseId=1');
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$res = curl_exec($ch);
echo curl_error($ch);;
print_r($res);
curl_close($ch);
Port 5001 is opened with firewall and IP not block by server