2

Has anyone heard of problems using RCurl vs. httr when the user is using a proxy?

I have this package taxize in which some functions use RCurl and some use httr. A user reports two functions that don't require her to pass in proxy details, and those two functions use RCurl internally. While some functions that don't work without proxy auth details passed in use httr. In all cases, these are GET requests.

Is it possible that RCurl somehow handles the proxy without her having to pass in her proxy username, password, etc., while httr requires them? If so, why would that be?

This gist has examples of 2 functions that apparently require proxy auth details and 2 that don't.

sckott
  • 5,755
  • 2
  • 26
  • 42
  • Did you maybe set [default proxy settings for RCurl](http://stackoverflow.com/questions/25120043/rcurl-default-proxy-settings) and not for `httr` in the session? – MrFlick Aug 25 '14 at 18:41
  • Thanks @MrFlick One of my users is the one behind the proxy, not me. She said she had to pass in proxy auth details for fxns that use `httr` internally, but not to those fxns that use `RCurl`. – sckott Aug 25 '14 at 18:48
  • Given that httr calls RCurl eventually, it's hard to imagine why there should be any difference. – hadley Aug 25 '14 at 21:11
  • @hadley I agree! I don't understand either. Perhaps I'll move everything to `httr` so that at least that eliminates variation due to internal curl processes – sckott Aug 25 '14 at 21:49
  • RCurl supports auth settings, which you can view and change with `options(RCurlOptions = list(proxy="gateway:port", proxyuserpwd="user:password"...`. I know you're saying that your user does not have to specify authentication settings with RCurl so to answer this, I searched the source code on GitHub and verified it on my own machine - the default proxy option is NULL. Either auth settings are being grabbed from outside of R or they were set at some earlier point. You can verify this by running the getOption command above. Let us know the result. – Hack-R Aug 26 '14 at 11:50
  • Any updates? I'm having a similar issue where if I set the RCurl proxy options and use RCurl they are utilized, however when I use httr they are not utilized. – variable Apr 17 '15 at 07:55
  • :: update:: I've found you can pass the httr option with use_proxy. – variable Apr 17 '15 at 08:02
  • @variable what does that look like – sckott Apr 17 '15 at 19:36

1 Answers1

3

On Windows, I had to unset my environment proxy settings to successfully use httr

Sys.unsetenv("http_proxy")
Colin
  • 930
  • 3
  • 19
  • 42