PHP cURL against ISA Proxy

34 views
Skip to first unread message
Message has been deleted

haryx8

unread,
Mar 24, 2010, 5:37:08 AM3/24/10
to BengkelProgram, aryo.s...@gmail.com
Assalamu'alaikum, Selamat sore kawan2,

Saya dapat problem saat mau mengakses sebuah halaman web dari internet
menggunakan curl di PHP,
kondisinya... jika saya mau mengakses internet saya harus memasukan
username & password via Proxy (ISA Server)

berikut saya lampirkan script php yang saya gunakan (Just copy paste
from php_manual.chm hehehhe)

<?php
error_reporting(E_ALL);

$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows
NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL,"http://php.net/");
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 0);
curl_setopt($ch, CURLOPT_PROXY, "10.1.1.10:8090");
$page = curl_exec($ch);

echo $page;

curl_close($ch);
?>

walaupun sudah memberikan informasi IP Proxy, Username & Password
tetap saja saya tidak bisa mengakses halaman web tersebut
berikut saya lampirkan pesan error (407) dari ISA Proxy nya:


X Maaf Access Internet Anda Terganggu: The page cannot be displayed
Explanation: There is a problem with the page you are trying to reach
and it cannot be displayed.

Try the following:
Refresh page: Search for the page again by clicking the Refresh
button. The timeout may have occurred due to Internet congestion.
Check spelling: Check that you typed the Web page address correctly.
The address may have been mistyped.
Access from a link: If there is a link to the page you are looking
for, try accessing the page from that link.
If you are still not able to view the requested page, try contacting
your administrator or Helpdesk.

Technical Information (for support personnel)
Error Code: 407 Proxy Authentication Required. The ISA Server requires
authorization to fulfill the request. Access to the Web Proxy filter
is denied. (12209)
IP Address: 10.1.1.10
Date: 3/24/2010 8:23:47 AM [GMT]
Server: svr-proxy.company.co.id
Source: proxy

sekian keluh kesah dari saya, mohon pencerahannya yah dari para
Pendekar.
Wassalaam

Hary Lindqvist

unread,
Apr 30, 2012, 5:09:13 AM4/30/12
to bengkel...@googlegroups.com, aryo.s...@gmail.com
Wahhh.. akhirnya ketemu juga nih cara ngebypass proxy yang selalu minta authentikasi,
untuk kebutuhan remote file menggunakan cURL di PHP.

tambahin ini aja di enviroment cURL:

curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $config['USERPASSWD']);
curl_setopt($ch, CURLOPT_PROXY, $config['PROXY']);
curl_setopt($ch, CURLOPT_PROXYPORT, $config['PORT']);
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_NTLM);

Soesapto Joeni Hantoro

unread,
Apr 30, 2012, 5:22:04 AM4/30/12
to bengkel...@googlegroups.com
tengkyu sharingnya om :)

--
URL group: http://groups.google.com/group/bengkelprogram?hl=id
Untuk keluar dari grup ini, kirim email kosong ke bengkelprogra...@googlegroups.com
Website: http://www.bengkelprogram.com

Reply all
Reply to author
Forward
0 new messages