[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: somewhat OT: http_proxy format (was: tor controller hangs / doesn't reply)



Quoth Scott Bennett <bennett@xxxxxxxxxx>, on 2009-06-03 08:17:10 -0500,
providing neither a References nor an In-Reply-To header:
>      On Wed, 03 Jun 2009 09:01:09 -0400 Sambuddho Chakravarty
> <sc2516@xxxxxxxxxxxx> top-posted (grrr...):
> >I am using :-
> >
> > http_proxy=http://localhost:8118
> >
>      Well, you probably need to fix that first.  Both ftp_proxy and
> http_proxy are supposed to be set to the *proxy*, not to a URL.  (See
> fetch(3) for more information.)

I believe that this idea does not reflect current practice, at least
on GNU/Linux systems, and that Sambuddho's usage is correct for Bourne
shell, modulo a possibly-missing "export" command.  (Not that current
practice is particularly well-defined in this case.)

From the GNU Wget 1.11.4 manual, node "Proxies", at
http://www.gnu.org/software/wget/manual/html_node/Proxies.html:
| http_proxy
| https_proxy
|     If set, the http_proxy and https_proxy variables should contain
|     the URLs of the proxies for HTTP and HTTPS connections
|     respectively.

From curl(1), from curl 7.19.5:
| http_proxy [protocol://]<host>[:port]
|     Sets the proxy server to use for HTTP.

From lftp(1), from LFTP 3.7.13:
| http:proxy (URL)
|     specifies http proxy.  It is used when lftp works over http
|     protocol.  Default value is taken from environment variable
|     http_proxy.  If your proxy requires authentication, specify user
|     name and password in the URL.

From lynx(1), from Lynx 2.8.7pre4:
| PROTOCOL_proxy
|     Lynx supports the use of proxy servers that can act as firewall
|     gateways and caching servers.  They are preferable to the older
|     gateway servers (see WWW_access_GATEWAY, below).  Each protocol
|     used by Lynx, (http, ftp, gopher, etc), can be mapped separately
|     by setting environment variables of the form PROTOCOL_proxy
|     (literally: http_proxy, ftp_proxy, gopher_proxy, etc), to
|     "http://some.server.dom:port/";.  See Lynx Users Guide for
|     additional details and examples.

From perldoc for LWP::UserAgent, from libwww-perl 5.826:
| $ua->env_proxy
|     Load proxy settings from *_proxy environment variables.  You
|     might specify proxies like this (sh-syntax):
| 
|       gopher_proxy=http://proxy.my.place/
|       wais_proxy=http://proxy.my.place/
|       no_proxy="localhost,my.domain"
|       export gopher_proxy wais_proxy no_proxy
(This doesn't reference http_proxy specifically, but I interpret it to
mean that all *_proxy environment variables (except no_proxy) use
URLs, which is consistent with the rest of the page.)

I can't find a copy of the aforementioned fetch(3) page anywhere on
the Web or on any system to which I have access.

Much of this software is common on other Unix-like systems, and to my
knowledge their environment variable semantics are not changed there.
The consensus for users appears to be that you should set *_proxy
variables to URLs with the scheme and host component required and the
port and authentication components optional.  The consensus for
programs appears to be that you should accept *_proxy variables in
either URL format or in raw host[:port] format with the equivalent URL
scheme defaulting to that for the protocol for which the variable is
set.

   ---> Drake Wilson