cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Proxy

From: Michel RIGAUD <rigaud.michel_at_gmail.com>
Date: Thu, 5 Feb 2009 15:43:15 +0100

2009/2/1 Daniel Stenberg <daniel_at_haxx.se>

> On Sun, 1 Feb 2009, Michel RIGAUD wrote:
>
> On the first connection to the proxy, do I need to indicate the url of the
>> web site I want to access ? I am asking that because in the first syntax you
>> are saying "curl -v -x proxy:port [url]" by [url] you mean which URL ?
>>
>
> curl always requires a url for every command, so yes you do.
>
> Once I detected which auth method to use and I connected once with :
>> curl -U user:password -x proxy:port
>> --proxy-[digest/basic/negotiate/ntlm/any] [URL]
>> do I need to repeat user:password at every request or is there a way tell
>> the proxy I already connected?
>>
>
> You aren't "already connected", as each curl invoke will connect and
> disconnect again so yes you do need to provide -U and --proxy* options on
> every subsequent curl command. You can of course script it or use a .curlrc
> or similar.
>
> (And please avoid top-posting.)
>
>
> --
>
> / daniel.haxx.se
> -------------------------------------------------------------------
> List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
> FAQ: http://curl.haxx.se/docs/faq.html
> Etiquette: http://curl.haxx.se/mail/etiquette.html
>

Hello

I still can't get thru the proxy
with the command curl -U user:password -x proxy:port
I get a 404

with this curl -U user:password -x proxy:port
--proxy-[digest/basic/negotiate/ntlm/any] [URL]
I get what follows

Any idea ?

== Info: About to connect() to mcd-server port 80 (#0)
== Info: Trying 198.155.109.128... == Info: connected
== Info: Connected to mcd-server (198.155.109.128) port 80 (#0)
=> Send header, 163 bytes (0xa3)
0000: GET /mcd/proxy.pac HTTP/1.1
001d: User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.
005d: 0.5) Gecko/2008120122 Firefox/3.0.5
0082: Host: mcd-server
0094: Accept: */*
00a1:
<= Recv header, 17 bytes (0x11)
0000: HTTP/1.1 200 OK
<= Recv header, 33 bytes (0x21)
0000: Server: Netscape-Enterprise/6.0
<= Recv header, 37 bytes (0x25)
0000: Date: Thu, 05 Feb 2009 13:40:32 GMT
<= Recv header, 49 bytes (0x31)
0000: Content-type: application/x-ns-proxy-autoconfig
<= Recv header, 28 bytes (0x1c)
0000: Etag: "a91ef479-56-0-12e7"
<= Recv header, 46 bytes (0x2e)
0000: Last-modified: Wed, 14 Jan 2009 18:27:49 GMT
<= Recv header, 22 bytes (0x16)
0000: Content-length: 4839
<= Recv header, 22 bytes (0x16)
0000: Accept-ranges: bytes
<= Recv header, 2 bytes (0x2)
0000:
<= Recv data, 1432 bytes (0x598)
0000: // Automatic Proxy Configuration File.// Last update: 20081014./
0040: / Location: http://mcd-server/mcd/proxy.pac..function FindProxyF
0080: orURL(url, host).{..if (isPlainHostName(host))...return "DIRECT"
00c0: ;..else if (dnsDomainIs(host, "www.bms.com"))...return "PROXY pr
0100: oxy-server:8080; PROXY proxybk-server:8080";..else if (dnsDomain
0140: Is(host, "www-preview.bms.com"))...return "PROXY proxy-server:80
0180: 80; PROXY proxybk-server:8080";..else if (dnsDomainIs(host, "www
01c0: -admin.bms.com"))...return "PROXY proxy-server:8080; PROXY proxy
0200: bk-server:8080";..else if ((dnsDomainIs(host, "recon.bms.com"))
0240: || (host == "217.58.157.188"))...return "PROXY proxy-server:8080
0280: ; PROXY proxybk-server:8080";..else if ((dnsDomainIs(host, "bene
02c0: fitsexpressd.bms.com")) || (host == "206.126.176.111"))...return
0300: "PROXY proxy-server:8080; PROXY proxybk-server:8080";..else if
0340: ((dnsDomainIs(host, "benefitsexpressq.bms.com")) || (host == "20
0380: 6.126.176.113"))...return "PROXY proxy-server:8080; PROXY proxyb
03c0: k-server:8080";..else if ((dnsDomainIs(host, "benefitsexpress.bm
0400: s.com")) || (host == "206.126.176.115"))...return "PROXY proxy-s
0440: erver:8080; PROXY proxybk-server:8080";..else if ((dnsDomainIs(h
0480: ost, "benefitsexpresskd.bms.com")) || (host == "206.126.176.112"
04c0: ))...return "PROXY proxy-server:8080; PROXY proxybk-server:8080"
0500: ;..else if ((dnsDomainIs(host, "benefitsexpresskq.bms.com")) ||
0540: (host == "206.126.176.114"))...return "PROXY proxy-server:8080;
0580: PROXY proxybk-server:808
<= Recv data, 1432 bytes (0x598)
0000: 0";..else if ((dnsDomainIs(host, "benefitsexpressk.bms.com")) ||
0040: (host == "206.126.182.18"))...return "PROXY proxy-server:8080;
0080: PROXY proxybk-server:8080";..else if ((dnsDomainIs(host, "invest
00c0: or.bms.com")) || (host == "170.224.5.43"))...return "PROXY proxy
0100: -server:8080; PROXY proxybk-server:8080";..else if ((dnsDomainIs
0140: (host, "learningwiki.bms.com")) || (host == "63.246.7.212"))...r
0180: eturn "PROXY proxy-server:8080; PROXY proxybk-server:8080";..els
01c0: e if ((dnsDomainIs(host, "eservice.hsa.gov.sg")) || (host == "16
0200: 0.96.5.226"))...return "DIRECT";..else if (dnsDomainIs(host, "ww
0240: w.hsa.gov.sg") )...return "DIRECT";..else if (dnsDomainIs(host,
0280: "newsroom.bms.com"))...return "PROXY proxy-server:8080; PROXY pr
02c0: oxybk-server:8080";..else if (dnsDomainIs(host, "prevail.bms.com
0300: "))...return "PROXY proxy-server:8080; PROXY proxybk-server:8080
0340: ";..else if (dnsDomainIs(host, ".bms.com"))...return "DIRECT";..
0380: else if (dnsDomainIs(host, ".dmpc.com"))...return "DIRECT";..els
03c0: e if (dnsDomainIs(host, "sbt.carlsonwagonlit.com"))...return "PR
0400: OXY proxy-server.evv.stf.bms.com:8080; PROXY proxybk-server:8080
0440: ";..else if ((dnsDomainIs(host, "vwrportal.vwr.com")) || (host =
0480: = "66.54.172.25"))...return "DIRECT";..else if ((dnsDomainIs(hos
04c0: t, "vwrirapa.vwr.com")) || (host == "66.54.172.44"))...return "D
0500: IRECT";..else if ((dnsDomainIs(host, "www.iian.ibeam.com")) || (
0540: host == "64.200.42.173"))...return "DIRECT";..else if (dnsDomain
0580: Is(host, "preint-oneup-b
<= Recv data, 1975 bytes (0x7b7)
0000: ms-fr.cegedimdendrite.com")). return "DIRECT";..e
0040: lse if (dnsDomainIs(host, "max.chemwatch.net")).
0080: return "DIRECT";..else if (dnsDomainIs(host, "full.chemwatch.net
00c0: ")). return "DIRECT";..else if (dnsDomainIs(host,
0100: "gateway.fedex.com")). return "DIRECT";.
0140: else if (dnsDomainIs(host, "wwwbeta.gedex.com")).
0180: return "DIRECT";..else if ((host == "52.99.40.18")||(host == "5
01c0: 2.99.21.12"))...return "DIRECT";..else if ((host == "164.164.94.
0200: 210")||(host == "164.164.94.221"))...return "DIRECT";..else if (
0240: (host == "202.3.10.222"))...return "DIRECT";..else if ((host ==
0280: "125.17.164.134"))...return "DIRECT";..else if ((dnsDomainIs(hos
02c0: t, "bms.claritynet.com")) || (host == "216.54.4.178"))...return
0300: "DIRECT";..else if ((host == "retaillink.wal-mart.com") || (host
0340: == "161.165.206.20"))...return "DIRECT";..else if ((host == "iw
0380: a.bms.bridge.eds.com") || (host == "158.117.209.11"))...return "
03c0: DIRECT";..else if ((host == "69-24-32-250.ptr.p2pa.com") || (hos
0400: t == "69.24.32.250"))...return "DIRECT";..else if ((host == "www
0440: .adpweb.com.br") || (host == "200.211.14.200"))...return "DIRECT
0480: ";..else if ((shExpMatch(host, "140.176.*[0-9]"))||(shExpMatch(h
04c0: ost, "165.89.*[0-9]"))||(shExpMatch(host, "198.155.*[0-9]")))...
0500: return "DIRECT";..else if ((shExpMatch(url, "*.mozy.com*"))||(sh
0540: ExpMatch(url, "*.mozypro.com*"))||(shExpMatch(url, "*.berkeleyda
0580: ta.com*")))...return "PROXY mozybk.net.bms.com:8080";..else if
05c0: ((shExpMatch(url, "*eassist.compucom.com*"))). re
0600: turn "DIRECT";..else if ((shExpMatch(url, "*www.nielsencast.com*
0640: "))). return "DIRECT";..else if ((shExpMatch(url,
0680: "*www.hsa.gov.sg*"))). return "DIRECT";..else if
06c0: (isInNet(host, "140.176.0.0", "255.255.0.0")). r
0700: eturn "DIRECT";..else if ( (dnsDomainLevels(host) == 3) && (shEx
0740: pMatch(host, "127.*[0-9]")))...return "DIRECT";..else...return "
0780: PROXY proxy-server:8080; PROXY proxybk-server:8080";.}.
== Info: Connection #0 to host mcd-server left intact
== Info: About to connect() to www.pharmatic.fr port 80 (#1)
== Info: Trying 195.8.78.1... == Info: Timed out
== Info: couldn't connect to host
== Info: Closing connection #1
== Info: Closing connection #0

-------------------------------------------------------------------
List admin: http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2009-02-05