11

I'm trying to use stack behind a corporate proxy. Issuing the stack new command returns:

InvalidProxyEnvironmentVariable "http_proxy" "http://username:password@host:port/"

I have http_proxy, https_proxy and ftp_proxy defined in my .bashrc, as well as their equivalents in all caps (e.g. HTTP_PROXY). Removing or altering those will break stuff elsewhere.

The stack repo doesn't seem to have proxy behaviour documented yet, which is understandable since it was only recently released. Does anyone know if using stack behind a proxy is even possible at the moment? If so, how?

duplode
  • 33,731
  • 7
  • 79
  • 150
cms_mgr
  • 1,977
  • 2
  • 17
  • 31
  • 2
    Actually, that pull request only added support for authentication values in the request URL itself, not in talking with the proxy. [This is the relevant line.](https://github.com/snoyberg/http-client/blob/dc981b9fde57d77ccecf0171a96fb92c5cb5712f/http-client/Network/HTTP/Client/Manager.hs#L503) This is worth opening as an http-client issue – Michael Snoyman Jun 30 '15 at 11:10
  • @MichaelSnoyman okay thanks, I'll do it when I get home. – cms_mgr Jun 30 '15 at 12:27

1 Answers1

9

This is a limitation of http-client, which has now been reported and resolved. This change will get released to Hackage in the next few days, and then hopefully the next official build of stack will include the change. If you're adventurous, you can build the http-proxy-auth branch, which includes this fix pre-release.

Michael Snoyman
  • 31,100
  • 3
  • 48
  • 77
  • 1
    http-client with proxy auth fix has been released to the Hackage. please, release stack with it, we can not use stack behind corporate proxy :-/ – Pavel Martynov Aug 04 '15 at 06:17
  • 3
    I am also using a proxy and stack doesn't work for me. I get a `ProxyConnectException`, with `statusMessage = \"Proxy Authentication Required\"`. I have the `http_proxy` and `https_proxy` environment variables set up, and interacting with github works, but stack fails. – Stephan Sep 03 '15 at 18:46