Les meilleurs développeurs PHP freelances sont sur Codeur.com

Exécution d'une page web en ligne via un proxy

 Fermé · Moins de 500 € · 3 offres · 538 vues · 7 interactions


Bonjour,

je souhaite créer un petit script (php si possible) qui permet de charger une page web via un proxy. J'ai déjà créer un code avec Curl qui le fait en grande partie, mais malheureusement Curl ne gère pas le javascript. Je souhaite donc améliorer ce script pour le faire. Il existe des librairie type php-phantomjs qui permettent d'accomplir ce genre de tache. Je recherche donc un développeur qui puisse m'aider a accomplir ceci.

Voici le code actuel:

$url = 'adresse du site';

$timeout = 10;

$ch = curl_init($url);

curl_setopt($ch, CURLOPT_FRESH_CONNECT, true);
curl_setopt($ch, CURLOPT_TIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);

if (preg_match('`^https://`i', $url))
{
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
}

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_URL,$url);
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 0);
curl_setopt($ch, CURLOPT_PROXY, $data_proxy['content']);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST,'GET');

curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_REFERER, '');

curl_setopt($ch, CURLOPT_USERAGENT, $data_user_agent['content']);
echo '<b>IP : '.$data_proxy['content'].'; User_agent: '.$data_user_agent['content'].'</b><br>';

$page_content = curl_exec($ch);

curl_close($ch);

echo $page_content;

Budget indicatif : Moins de 500 €

Publication : 22 janvier 2017 à 16h33

Profils recherchés : Développeur PHP freelance

Le profil du client est reservé aux prestataires abonnés

Créer un compte

3 freelances ont répondu à ce projet

1 proposition de devis en moins de 2h

Latika Sood Chef de projet
referia Agence web
mcoeur Développeur full-stack
Publier un projet similaire

Chaque jour, des centaines de clients utilisent Codeur.com pour trouver un prestataire. Créez votre compte dès maintenant, remplissez votre profil et trouvez de nouveaux clients.

Trouver des nouveaux clients