[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add support for HTTP proxies
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] Add support for HTTP proxies |
Date: |
Wed, 12 Jun 2013 09:54:49 +0200 |
User-agent: |
Gnus/5.130007 (Ma Gnus v0.7) Emacs/24.3 (gnu/linux) |
Hi!
Looks good!
Mark H Weaver <address@hidden> skribis:
> Here's a much simpler patch that discards the keyword arguments of the
> previous version, so that the only new interfaces are:
>
> * The 'http_proxy' environment variable.
> * The 'current-http-proxy' parameter.
> * The 'http-proxy-port?' object property (only needed if you connect to
> a proxy yourself, without using 'open-socket-for-uri').
What about hiding the fact that it’s an object property, by providing a
‘set-http-proxy-port?!’ procedure?
> +(define current-http-proxy (make-parameter 'auto))
> +
> +(define (choose-http-proxy)
> + (let ((proxy (current-http-proxy)))
> + (if (not (eq? proxy 'auto))
> + proxy
> + (let ((proxy (getenv "http_proxy")))
> + (and (not (equal? proxy ""))
> + proxy)))))
What about just:
(make-parameter (getenv "http_proxy"))
I guess the next issue will be authentication, but I’m afraid we lack
the needed crypto primitives in Guile core to do that.
Thanks for working on this!
Ludo’.