stack does not use proxy setting in windows

Created on 19 Jan 2016  Â·  3Comments  Â·  Source: commercialhaskell/stack

http_proxy and https_proxy environment variable does not work, which works on mac
And the proxy in Internet Options does not work either :(

at least on version 1.0.2

Most helpful comment

It's work on Linux with :

export http_proxy = "http://127.0.0.1:3128"
export https_proxy = "http://127.0.0.1:3128"

and in stack.yaml :

nix:
  enable: true
  pure: false

All 3 comments

I don't have a proxy setup to test with, but if I set the proxy environment variables to a non-existent host I do get the errors I expect:

C:\Users\emanu>set http_proxy=http://192.168.99.99

C:\Users\emanu>set https_proxy=http://192.168.99.99

C:\proj\stack>stack --version
Version 1.0.2, Git revision fa09a980d8bb3df88b2a9193cd9bf84cc6c419b3 (3084 commits) i386

C:\proj\stack>stack update
Downloading package index from https://s3.amazonaws.com/hackage.fpcomplete.com/00-index.tar.gz
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpcomplete.com/00-index.tar.gz)
...FailedConnectionException2 "192.168.99.99" 80 True connect: failed (Connection timed out (WSAETIMEDOUT))

So the proxy seems to be used at least for this case. Can you be more specific about exactly where the proxy is not being used (e.g., provide stack --verbose output)?

I had the same issue.

D:\local\haskell\hewoStack>stack setup --verbose
Version 1.0.2, Git revision fa09a980d8bb3df88b2a9193cd9bf84cc6c419b3 (3084 commits) x86_64
InvalidProxyEnvironmentVariable "https_proxy" "https://1.2.3.4:1111"

Then I found the solution for my problem in https://github.com/snoyberg/http-client/issues/175:
The proxy must be configured as http://1.2.3.4:1111, not https://..

It's work on Linux with :

export http_proxy = "http://127.0.0.1:3128"
export https_proxy = "http://127.0.0.1:3128"

and in stack.yaml :

nix:
  enable: true
  pure: false
Was this page helpful?
0 / 5 - 0 ratings