Re: [PHP-ES] Permitir conexion desde PHP a sitio externo

[email protected] (ReynierPM)
Newsgroups php.general.es
Message-ID <[email protected]>
On 1/14/2010 5:29 pm, Jonathan Tapicer wrote:
> Hola,
>
> Si usás las funciones para leer archivos (file_get_contents, fopen,
> etc) para acceder a los sitios, necesitás pasarle un context con la ip
> y el puerto del proxy, por ejemplo:
>
> <?php
> $context = stream_context_create(array('http' =>  array('proxy' =>
> 'tcp://127.0.0.1:8080', 'request_fulluri' =>  true)));
>
> $html = file_get_contents("http://www.php.net", false, $context);
> ?>
>
> En el ejemplo se obtiene el html del sitio www.php.net usando el proxy
> 127.0.0.1 en el puerto 8080.
>
> Espero que te sirva, saludos,
>
> Jonathan

Muchas gracias, el ejemplo no me sirvió de mucho pero me dio un norte de 
por donde iba la cosa pues la aplicación usa cURL en vez de las 
funciones que antes mencionas.

-- 
Saludos
Ing. Reynier Pérez Mira
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.