[Haskell-cafe] http-client: proxy environment variable support

Michael Snoyman michael at snoyman.com
Mon Jan 19 13:53:17 UTC 2015


Neil Mitchell opened an issue[1] for http_proxy and https_proxy environment
variable support in http-client. I've written that support, and it's ready
to go, but there's an open question: what should the default behavior be?
In particular, should environment variables, by default, be checked to
determine the proxy, or not? Arguments each way:

In favor of using environment variables:
* Matches behavior of many other tools and libraries
* Allows application users control without requiring a code change from
application writers

Against using environment variables:
* It's a change in behavior vs what http-client does today (though that
could certainly be seen as just a missing feature)
* Environment variables will implicitly change the behavior of code, which
generally speaking can be problematic

I'm leaning towards having the default behavior be:

* If the user explicitly chooses a proxy setting on the manager, use that
* If the user explicitly sets a proxy value on the Request, use that
* If the environment variable is set, use that
* Otherwise, no proxy

In addition to whether we should make this change in behavior, I'm also
interested in whether people think this should require a major version bump.

[1] https://github.com/snoyberg/http-client/issues/94
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20150119/4dc43fd8/attachment.html>


More information about the Haskell-Cafe mailing list