1

I'm working here behind proxy so I need to configure my connection. It works well with defining options list and calling getURL:

opts <- list(
  proxy         = "http://****",
  proxyusername = "****", 
  proxypassword = "*****", 
  proxyport     = ****
)
getURL("http://stackoverflow.com", .opts = opts)

I'd like to set this options as defaults, but still cannot find any working solutions. Could you advise anything?

Thank you.

Дмитро Булах
  • 3,697
  • 1
  • 14
  • 23
  • You could explicitly create a curl handle (`getCurlHandle`) and then call `curlSetOpt` on that object, and use that as a parameter to all your get calls via the `curl=` parameter. – MrFlick Aug 04 '14 at 14:05
  • It looks like you also may be able to set an option with `options(RCurlOptions = list())` but I have not tried that myself. Just put all your values in that list. – MrFlick Aug 04 '14 at 14:41
  • Yes, MrFlick, options() works perfectly as I found yesterday – Дмитро Булах Aug 05 '14 at 06:27

1 Answers1

5

I regret to hurry up posting question. The solution was really at the hand, at RCurl FAQ page. There is an option RCurlOptions which can be defined at the Rprofile.site file of R

But I'm still in trouble because RGoogleAnalytics library seems to overwrite this.

For completeness, here is the code:

opts <- list(
  proxy         = "http://****",
  proxyusername = "****", 
  proxypassword = "*****", 
  proxyport     = ****
)

options(RCurlOptions = opts)

getURL("http://stackoverflow.com")
marbel
  • 7,560
  • 6
  • 49
  • 68
Дмитро Булах
  • 3,697
  • 1
  • 14
  • 23