Using proxy with stack hoogle

12 views
Skip to first unread message

Guanpeng Xu

unread,
Jan 14, 2018, 1:14:23 PM1/14/18
to haskell-stack
Hello,

I want to use stack hoogle through a proxy. Here is what I tried:

$ ~/.local/bin/stack --version
Version 1.6.3, Git revision b27e629b8c4ce369e3b8273f04db193b060000db (5454 commits) x86_64 hpack-0.20.0

$ env | grep proxy
https_proxy=socks5h://127.0.0.1:12800
http_proxy=socks5h://127.0.0.1:12800
no_proxy=127.0.0.1,localhost

$ ~/.local/bin/stack hoogle
Hoogle isn't installed. Automatically installing (use --no-setup to disable) ...
Minimum version is hoogle-5.0. Found acceptable hoogle-5.0.16 in your index, installing it.


Meanwhile these were the connections:

$ sudo netstat -nalp | grep stack
tcp        0      1 192.168.0.102:34104     54.231.120.226:443      SYN_SENT    22075/stack        
tcp        0      1 192.168.0.102:34106     54.231.120.226:443      SYN_SENT    22075/stack        
tcp        0      1 192.168.0.102:34108     54.231.120.226:443      SYN_SENT    22075/stack        
tcp        0      1 192.168.0.102:34100     54.231.120.226:443      SYN_SENT    22075/stack        
tcp        0      1 192.168.0.102:34102     54.231.120.226:443      SYN_SENT    22075/stack        
tcp        0      1 192.168.0.102:34110     54.231.120.226:443      SYN_SENT    22075/stack        
tcp        0      1 192.168.0.102:34098     54.231.120.226:443      SYN_SENT    22075/stack        
tcp        0      1 192.168.0.102:34112     54.231.120.226:443      SYN_SENT    22075/stack


It seems that the env vars were not respected. How to use proxy with stack hoogle?

Regards,
Guanpeng Xu

Neil Mitchell

unread,
Jan 14, 2018, 4:48:30 PM1/14/18
to Guanpeng Xu, haskell-stack
Hi Guanpeng,

Does it fail if you run without the proxy set? If so, can you paste a
trace with --verbose which includes the failure message? Generally,
the Haskell http library used by both Stack and Hoogle takes care of
http_proxy for you automatically so it's surprising that something
isn't picking it up.

Thanks, Neil
> --
> You received this message because you are subscribed to the Google Groups
> "haskell-stack" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to haskell-stac...@googlegroups.com.
> To post to this group, send email to haskel...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/haskell-stack/263843f5-fabb-44be-b18a-0ea11c1a413b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Guanpeng Xu

unread,
Jan 14, 2018, 7:06:49 PM1/14/18
to haskell-stack
Dear Neil,

Thanks for the tip. In the log I found out the reason. It was because that I enabled nix but did not make the environment impure. By adding pure: false the problem is resolved.

Regards,
Guanpeng Xu
Reply all
Reply to author
Forward
0 new messages