lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev Re: bug #25947, $http_proxy + /etc/lynx.cfg http_proxy


From: Klaus Weide
Subject: lynx-dev Re: bug #25947, $http_proxy + /etc/lynx.cfg http_proxy
Date: Mon, 30 Aug 1999 11:09:11 -0500 (CDT)

On Mon, 30 Aug 1999, Patrik Rak wrote:

> On Mon, 30 Aug 1999, Klaus Weide wrote:
> 
> > I have never seen something like this, certainly not if the *_proxy
> > variables/options are syntactically correct.  Note that the trailing '/'
> > is required.
> 
> I see. So this is the problem, obviously.

[ some detail snipped ]

> everything else is as per default, and there is no user's .lynx.cfg.

I think you mean ".lynxrc"? (which wouldn't be relevant for proxies).
Lynx doesn't look for a ".lynx.cfg" (unless the code was modified, or
".lynx.cfg" INCLUDEd from the system-wide lynx.cfg.

> If there is no $http_proxy, things work fine.
> 
> If I set it to http://proxy.ein.cz:3128, it does not work,
> regardless if I specify the URL on commandline or via the G)o command.
> For example, say I typed "lynx www.seznam.cz". Here is what squid sees:

Side note: use full URLs unless you don't mind some overhead (e.g.
unnecessary name lookups, checking for ./www.seznam.cz as a local
directory) caused by "guessing".

> 936018384.508    944 192.168.3.129 TCP_MISS/404 346 GET 
> http://www.seznam.cz/www.seznam.cz/ - DIRECT/www.seznam.cz text/html
> 
> However, if I set it to http://proxy.ein.cz:3128/, as you suggest above,
> it works again. But other programs don't insist on having the
> trailing slash in order to work, and lynx should follow, IMHO.

Ok, I am convinced, suggested patch below. (should also work for previous
versions)

I added the checks for 'normal case (1) because I don't fully understand
what's supposed to happen (if anything useful) in some other situations
including proxying of/to news/nntp etc. (2) to preserve some occasionally
useful tricks than can be played with proxy settings.  (Normally behavior
should be regarded as undefined if protocol_proxy points to something
else than http://... or possibly https://...)

  Klaus

* Supply trailing slash for protocol_proxy settings (whether environment
  variables or lynx.cfg) in HTAccess.c if the slash was omitted and if the
  content otherwise looks normal (starts with http, no su

--- lynx2-8-3.old/WWW/Library/Implementation/HTAccess.c Mon Jun 21 00:31:29 1999
+++ lynx2-8-3/WWW/Library/Implementation/HTAccess.c     Mon Aug 30 09:42:26 1999
@@ -519,6 +519,14 @@
        if (proxy) {
            char * gatewayed = NULL;
            StrAllocCopy(gatewayed,proxy);
+           if (!strncmp(gatewayed, "http", 4)) {
+               char *cp = strrchr(gatewayed, '/');
+               /* Append a slash to the proxy specification if it doesn't
+                * end in one but otherwise looks normal (starts with "http",
+                * has no '/' other than ones before the hostname). - kw */
+               if (cp && (cp - gatewayed) <= 7)
+                   LYAddHtmlSep(&gatewayed);
+           }
            /*
            ** Ensure that the proxy server uses ftp for file URLs. - FM
            */


reply via email to

[Prev in Thread] Current Thread [Next in Thread]