curl-and-php
Re: curl-and-php Digest, Vol 14, Issue 13
Date: Tue, 31 Oct 2006 10:31:58 -0500
Hi
I am using the php extension - php_curl.dll library.
I have an option within my web application, where I accept the Remote Host
URL or IP address to connect, from the user and use curl to connect and
process data. If there is no proxy server then the connection and the
data exchange goes through fine.
When there is an intermediate ISA Proxy Server to connect to the internet,
the user has to specify the Proxy Server address, windows login info.
The code I use when there is a proxy server is as follows:-
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HEADER, false); //if you
want the header
curl_setopt($ch, CURLOPT_RETURNTRANSFER , true); // return
the results as a string return value
curl_setopt($ch, CURLOPT_POST , true);
if (strlen(trim($proxy))>0)
{
$auth =
$_REQUEST[wDomain]."\\".$_REQUEST[uWindowsAl].":".$_REQUEST[uWindowsPa];
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL,1);
curl_setopt ($ch,CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_PROXY,$proxy);
curl_setopt($ch,CURLOPT_ProxyAUTH,CURLAUTH_NTLM);
curl_setopt($ch, CURLOPT_PROXYUSERPWD,$auth);
}
curl_setopt($ch, CURLOPT_POSTFIELDS,
"req=".urlencode($buf)."&");
$body = curl_exec($ch);
$http=curl_getinfo($ch);
$errDesc = curl_error($ch);
$errNo = curl_errno($ch);
curl_close($ch);
The out I am receiving is
(Embedded image moved to file: pic46872.jpg)
I hope the above information is sufficient to determine the problem.
Thanks
Best
Raji
Rajalakshmi Murali
Application Developer
Field Information Services Unit
United Nations Office for the Coordination of Humanitarian Affairs
New York
Tel: +1 917-367-2177
E-mail: murali_at_un.org
curl-and-php-requ
est_at_cool.haxx.se
Sent by: To
curl-and-php-boun curl-and-php_at_cool.haxx.se
ces_at_cool.haxx.se cc
Subject
31/10/2006 06:00 curl-and-php Digest, Vol 14, Issue
AM 13
Please respond to
curl-and-php_at_cool
.haxx.se
Send curl-and-php mailing list submissions to
curl-and-php_at_cool.haxx.se
To subscribe or unsubscribe via the World Wide Web, visit
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
or, via email, send a message with subject or body 'help' to
curl-and-php-request_at_cool.haxx.se
You can reach the person managing the list at
curl-and-php-owner_at_cool.haxx.se
When replying, please edit your Subject line so it is more specific
than "Re: Contents of curl-and-php digest..."
Today's Topics:
1. Re: curl via ISA Proxy Server (Daniel Stenberg)
----------------------------------------------------------------------
Message: 1
Date: Tue, 31 Oct 2006 09:09:53 +0100 (CET)
From: Daniel Stenberg <daniel_at_haxx.se>
Subject: Re: curl via ISA Proxy Server
To: curl with PHP <curl-and-php_at_cool.haxx.se>
Message-ID: <Pine.LNX.4.64.0610310908240.6395_at_yvahk3.pbagnpgbe.fr>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
On Mon, 30 Oct 2006, Rajalakshmi Murali wrote:
> My web application on a local server uses curl to connect via a proxy to
the
> internet to another global server to exchange data. The proxy is Windows
> Server 2003 with ISA Server 2004 .
> I am getting a status code of 0. Could you please advise me as to what
is
> it I am doing wrong?
There's a huge lack of details in your mail, but I would guess that your
request failed already on the CONNECT and you're not checking the
CURLINFO_HTTP_CONNECTCODE.
-- Commercial curl and libcurl Technical Support: http://haxx.se/curl.html ------------------------------ _______________________________________________ curl-and-php mailing list curl-and-php_at_cool.haxx.se http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php End of curl-and-php Digest, Vol 14, Issue 13 ********************************************
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php