[Filterproxy-devel] Re: FilterProxy-0.30 and upstream auth proxy problem
Brought to you by:
mcelrath
From: Bob M. <mce...@dr...> - 2002-05-09 21:07:38
|
John Straw [joh...@be...] wrote: > Bob McElrath writes: > > Could you try commenting out the line: > > $agent - env_proxy(); # process http_proxy environment varia= ble > > in FilterProxy.pl and see if it fixes your POST problem? From my > > reading of LWP::UserAgent, it won't, but it should. *then* we should > > file a bug. ;) This is an easy fix though, maybe I'll submit a patch > > against LWP. >=20 > I tried the following: >=20 > 1. reset the http_proxy variable in the FilterProxy.conf file to point > at my upstream proxy, _without_ the username:password hack. > http_proxy_user and http_proxy_password are still set in the file. >=20 > 2. comment out the line in FilterProxy.pl >=20 > 3. restarted FilterProxy. >=20 > No change in behavior. The only thing that works for me (that I know > about) is the username:password hack, which gets around the fact that > LWP chokes on the 407 return when performing a POST. >=20 > (I'm confused about what effect you expect this change to have, > though, because when FilterProxy has no http_proxy environment > variable set when I start it (now)) LWP doesn't actually call the get_basic_credentials method when it encounters a proxy-authorization challenge. This is basically the bug. However if the proxy info is set via the http_proxy environment variable, it is able to get that info correctly. It kinda makes sense that it should work this way though. Otherwise how would you access a website that needed authorization, through a proxy that needed a *different* authorization? (get_basic_credentials is what is used to get the user/pass for regular 'ol non-proxy HTTP basic authorization) I can modify FilterProxy to do this automatically, and work with the data on the config page. So based on all this I have added to my TODO file: =20 * Check http_proxy environment var and ignore it if it points to me.=20 * Print out what upstream proxy is geing used on startup. * Prefer config-page entered upstream proxy/user/pass to environment=20 variable http_proxy if they differ. * When upstream proxy requires authentication, construct: http_proxy =3D http://user:pass@host:port/ and pass this to $agent->proxy() rather than using get_basic_credential= s. (HTTP authorization challenges should be passed back to browser) * Investigate HTTP/1.1 and connection cache in LWP/Protocol/http.pm do not any more remove keep-alive and other HTTP/1.1 headers? =20 > > LWP man page: > > PERL_LWP_USE_HTTP_10 > > I guess it is using HTTP/1.1 now...that's new. ;) I shall have to > > investigate further, this could speed up FilterProxy a bit. Oooohhh... > > it looks like it now can keep a connection cache and re-use connections > > to upstream servers! ;) >=20 > I thought I had seen some stuff about 1.1 in there. I'll be glad if > my fumbling leads to productive hacking! ;) Prolly not for a while. I'm sooooo busy these days... If you feel like hacking some perl, go ahead, I prolly won't get to this fo= r a while. Cheers, -- Bob Bob McElrath (rsm...@st...)=20 Univ. of Wisconsin at Madison, Department of Physics |