Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

tcllib autoproxy difference between autoconfigure and manual configuration

26 views
Skip to first unread message

Harald Oehlmann

unread,
Nov 12, 2010, 4:12:48 AM11/12/10
to
It seams to be my "Please help"-day...

tcllib autoproxy and tcl 8.5.9 http package on windows vista with a
quid proxy server without authentication:

The following works well to fetch a file via our squid proxy server:
% package require http
% package require autoproxy
% ::autoproxy::init
% puts [::autoproxy::configure]
-authProc {} -basic {} -no_proxy {lilie lilie.naumburg.elmicron.de
naumburg.elmicron.de 192.168.200.147 <local>} -proxy_port 3128 -
proxy_host 192.168.200.147
% set hReq [http::geturl http://www.hibc.de/labelers.csv]
% puts [http::status $hReq]
ok
% puts [http::ncode $hReq]
200
% set Data [http::data $hReq]
...
% http::cleanup $hReq
---
Now I want to test manual setting of the parameter. I remove the proxy
parameters in Start->Control Pannel->Internet->Connections->LAN
Now the upper will fail (what is intended)

Now try it manually:
% package require http
% package require autoproxy
% ::autoproxy::init
% ::autoproxy::configure -host 192.168.200.147 -port 3128 -no_proxy
{lilie lilie.naumburg.elmicron.de naumburg.elmicron.de 192.168.200.147
<local>}
% puts [::autoproxy::configure]
-authProc {} -basic {} -no_proxy {lilie lilie.naumburg.elmicron.de
naumburg.elmicron.de 192.168.200.147 <local>} -proxy_port 3128 -
proxy_host 192.168.200.147
% set hReq [http::geturl http://www.hibc.de/labelers.csv]
% puts [http::status $hReq]
ok
% puts [http::ncode $hReq]
400

We get an "400 "bad request". But the "::autoproxy::configure" does
return the same data.
What is done in "autoproxy::init in plus, that makes it work with
automatic configuration ?

Thank you for any ideas,
Harald

Alexandre Ferrieux

unread,
Nov 12, 2010, 4:22:54 AM11/12/10
to
On Nov 12, 10:12 am, Harald Oehlmann <wortka...@yahoo.de> wrote:
> It seams to be my "Please help"-day...
>
> tcllib autoproxy and tcl 8.5.9 http package on windows vista with a
> quid proxy server without authentication:
>
> The following works well to fetch a file via our squid proxy server:
> % package require http
> % package require autoproxy
> % ::autoproxy::init
> % puts [::autoproxy::configure]
> -authProc {} -basic {} -no_proxy {lilie lilie.naumburg.elmicron.de
> naumburg.elmicron.de 192.168.200.147 <local>} -proxy_port 3128 -
> proxy_host 192.168.200.147
> % set hReq [http::geturlhttp://www.hibc.de/labelers.csv]

> % puts [http::status $hReq]
> ok
> % puts [http::ncode $hReq]
> 200
> % set Data [http::data $hReq]
> ...
> % http::cleanup $hReq
> ---
> Now I want to test manual setting of the parameter. I remove the proxy
> parameters in Start->Control Pannel->Internet->Connections->LAN
> Now the upper will fail (what is intended)
>
> Now try it manually:
> % package require http
> % package require autoproxy
> % ::autoproxy::init
> % ::autoproxy::configure -host 192.168.200.147 -port 3128 -no_proxy
> {lilie lilie.naumburg.elmicron.de naumburg.elmicron.de 192.168.200.147
> <local>}
> % puts [::autoproxy::configure]
> -authProc {} -basic {} -no_proxy {lilie lilie.naumburg.elmicron.de
> naumburg.elmicron.de 192.168.200.147 <local>} -proxy_port 3128 -
> proxy_host 192.168.200.147
> % set hReq [http::geturlhttp://www.hibc.de/labelers.csv]

> % puts [http::status $hReq]
> ok
> % puts [http::ncode $hReq]
> 400
>
> We get an "400 "bad request". But the "::autoproxy::configure" does
> return the same data.
> What is done in "autoproxy::init in plus, that makes it work with
> automatic configuration ?
>
> Thank you for any ideas,
> Harald

What about trying the "black box" approach ?
Wireshark -> filter on tcp:3128 -> follow TCP stream in both cases ->
compare GETs in detail.

-Alex

Harald Oehlmann

unread,
Nov 12, 2010, 4:54:17 AM11/12/10
to
> What about trying the "black box" approach ?
> Wireshark -> filter on tcp:3128 -> follow TCP stream in both cases ->
> compare GETs in detail.

O.k.: wireshark tcp.port == 3128

In the manual case, there are no packets send at all.
In the autoconfiguration case, there is a list of packets sent. The
get is as follows:

GET http://www.hibc.de/labelers.csv HTTP/1.1\r\n

and is sent to the proxy.

So remove the filter:
and the GET is requested like without a proxy and goes to
IP(www.hibc.de) Port 80.
So no proxy for this case.

So try without -no_proxy option -> same result.

Thank you,
Harald

Alexandre Ferrieux

unread,
Nov 12, 2010, 6:24:14 AM11/12/10
to
On Nov 12, 10:54 am, Harald Oehlmann <wortka...@yahoo.de> wrote:
> > What about trying the "black box" approach ?
> > Wireshark -> filter on tcp:3128 -> follow TCP stream in both cases ->
> > compare GETs in detail.
>
> O.k.: wireshark tcp.port == 3128
>
> In the manual case, there are no packets send at all.
> In the autoconfiguration case, there is a list of packets sent. The
> get is as follows:
>
> GEThttp://www.hibc.de/labelers.csvHTTP/1.1\r\n

>
> and is sent to the proxy.
>
> So remove the filter:
> and the GET is requested like without a proxy and goes to
> IP(www.hibc.de) Port 80.
> So no proxy for this case.
>
> So try without -no_proxy option -> same result.
>
> Thank you,
> Harald

Sorry I'm lost, dunno what exactly you are asking about. The wireshark
test showed you that the failing test was actually omitting the use
of a proxy ... so we learnt something, right ?
Now to proceed, I'd look at the -proxyfilter option of
http::configure, to see whether it was set properly in either case.

-Alex

Harald Oehlmann

unread,
Nov 12, 2010, 8:34:17 AM11/12/10
to
On 12 Nov., 12:24, Alexandre Ferrieux <alexandre.ferri...@gmail.com>
wrote:

> Sorry I'm lost, dunno what exactly you are asking about. The wireshark
> test showed you that the failing test was actually  omitting the use
> of a proxy ... so we learnt something, right ?
> Now to proceed, I'd look at the -proxyfilter option of
> http::configure, to see whether it was set properly in either case.

The aim was to use a proxy. The case to not use the proxy was IMHO an
error.
The final destination was not covered by the "-no_proxy" expression,
but the proxy-server itself was.

To check if the -no_proxy option had any influence, I removed it for
test.
It had no influence. It should work with and without anyway.

----
http:config - very good, lets try:

1) With Proxy enabled in Windows Settings:

% package require http
2.7.5
% puts [http::config]
-accept */* -proxyfilter http::ProxyRequired -proxyhost {} -proxyport
{} -urlencoding utf-8 -useragent {Tcl http client package 2.7.5}
% package require autoproxy
1.5.1
% puts [http::config]
-accept */* -proxyfilter http::ProxyRequired -proxyhost {} -proxyport
{} -urlencoding utf-8 -useragent {Tcl http client package 2.7.5}
% ::autoproxy::init
http://192.168.200.147:3128
% puts [http::config]
-accept */* -proxyfilter ::autoproxy::filter -proxyhost {} -proxyport
{} -urlencoding utf-8 -useragent {Tcl http client package 2.7.5}


% set hReq [http::geturl http://www.hibc.de/labelers.csv]

::http::1
% puts [http::config]
-accept */* -proxyfilter ::autoproxy::filter -proxyhost {} -proxyport
{} -urlencoding utf-8 -useragent {Tcl http client package 2.7.5}
9 % puts [http::status $hReq]


ok
% puts [http::ncode $hReq]
200

% http::cleanup $hReq
---
So the only visible item in the http::config is the -proxyfilter
setting.

2) With proxy disabled in windows settings and manual proxy setting:

% package require http
2.7.5
% puts [http::config]
-accept */* -proxyfilter http::ProxyRequired -proxyhost {} -proxyport
{} -urlencoding utf-8 -useragent {Tcl http client package 2.7.5}
% package require autoproxy
1.5.1
% puts [http::config]
-accept */* -proxyfilter http::ProxyRequired -proxyhost {} -proxyport
{} -urlencoding utf-8 -useragent {Tcl http client package 2.7.5}
% ::autoproxy::init
% puts [http::config]
-accept */* -proxyfilter http::ProxyRequired -proxyhost {} -proxyport
{} -urlencoding utf-8 -useragent {Tcl http client package 2.7.5}


% ::autoproxy::configure -host 192.168.200.147 -port 3128

% puts [http::config]
-accept */* -proxyfilter http::ProxyRequired -proxyhost {} -proxyport
{} -urlencoding utf-8 -useragent {Tcl http client package 2.7.5}


% set hReq [http::geturl http://www.hibc.de/labelers.csv]

::http::1
% puts [http::config]
-accept */* -proxyfilter http::ProxyRequired -proxyhost {} -proxyport
{} -urlencoding utf-8 -useragent {Tcl http client package 2.7.5}


% puts [http::status $hReq]
ok
% puts [http::ncode $hReq]
400

% http::cleanup $hReq
---

Obviously, the autoproxy module does not hook into the http package by
setting the -proxyfilter option.
Thus try to set this manually:

% package require http
2.7.5
% package require autoproxy
1.5.1


% ::autoproxy::init
% ::autoproxy::configure -host 192.168.200.147 -port 3128

% puts [http::config]
-accept */* -proxyfilter http::ProxyRequired -proxyhost {} -proxyport
{} -urlencoding utf-8 -useragent {Tcl http client package 2.7.5}
% http::config -proxyfilter ::autoproxy::filter


% set hReq [http::geturl http://www.hibc.de/labelers.csv]

::http::1


% puts [http::status $hReq]
ok
% puts [http::ncode $hReq]
200

% http::cleanup $hReq

... and it worked, thank you !

Lets try to find out why autoproxy does not hook into the http proxy
system.

- Remove autoproxy::init -> as it may disaple any proxy as there is
none in the system
-> does not help, configure does not set the http option.

I finally looked to the code. The only place were the hook is done is
when autiproxy::init wether got a proxy on command line or found one
in the system. As this is not the case in the code, it is never done.

I think it is time for:
- good friday afternoon tea
- file a bug report
- merci bien, Alexandre, de me pousser jusqu'au c'est finalement
trouvé.

Enjoy your day,
Harald

0 new messages