estoy tratando de crear un fichero php alojado en un dominio con https para que haga una llamada a otro servidor http a traves del puerto 1234. Lo he intentado con $ajax jsonp y con curl y en todos los casos me dice que el contenido es bloqueado.
Las pruebas con POSTMAN y poniendo la url directamente en el navegador funcionando.
Pero hay algo más en el PHP que no funciona.
¿Que puedo estar haciendo mal?
Os pongo el ejemplo de curl
Código:
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: *");
echo 'kaka aa';
$ch = curl_init("http://aquipongolaweballamar.net:1234"); // initialize curl handle
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_PORT, 1234);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Return the result to a variable
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_NOSIGNAL, 3);
// Fail on errors?
curl_setopt($ch, CURLOPT_FAILONERROR, 3);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 3);
// Timeout after X seconds
curl_setopt($ch,CURLOPT_TIMEOUT,10);
$data = curl_exec($ch);
$http_status_code = @curl_getinfo($ch, CURLINFO_HTTP_CODE);
print($data);
echo 'status;'.$http_status_code;
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Headers: *");
echo 'kaka aa';
$ch = curl_init("http://aquipongolaweballamar.net:1234"); // initialize curl handle
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_PORT, 1234);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Return the result to a variable
curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
curl_setopt($ch, CURLOPT_NOSIGNAL, 3);
// Fail on errors?
curl_setopt($ch, CURLOPT_FAILONERROR, 3);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT, 3);
// Timeout after X seconds
curl_setopt($ch,CURLOPT_TIMEOUT,10);
$data = curl_exec($ch);
$http_status_code = @curl_getinfo($ch, CURLINFO_HTTP_CODE);
print($data);
echo 'status;'.$http_status_code;