skardhamar / rga

R Google Analytics
186 stars 89 forks source link

Couldn't connect to host #5

Open cloga opened 11 years ago

cloga commented 11 years ago

Is there some configuration options to set the proxy? There are some restriction in my networks , so I need to use RGA with proxy. And I have tried to setInternet2(use = TRUE) and set the proxy in system internet options,and use download.file method to test my proxy setting , it seems that the proxy is active in download.file method , but when I try rga.open it still report couldn't connect to host. How can I solve this problem?Many thanks.

rga.open(instance="ga") Browse URL: https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/analytics.readonly&state=%2Fprofile&redirect_uri=urn:ietf:wg:oauth:2.0:oob&response_type=code&client_id=862341168163-qtefv92ckvn2gveav66im725c3gqj728.apps.googleusercontent.com&approval_prompt=force&access_type=offline Please enter code here: 4/FLbMwvBAjmakNWGU5j9xm-O-qQmn.AmsGK4hYmmQWgrKXntQAax3-2WwJegI Error :function (type, msg, asError = TRUE) : couldn't connect to host

WillemPaling commented 11 years ago

I just started a new job and am now having the same issue. Unfortunately no idea how to solve it just yet.

manugarri commented 11 years ago

Same situation here. When I authenticate myself on the browser and paste the code back to R, it spits out the error:

Error in function (type, msg, asError = TRUE) : Could not resolve host: accounts.google.com; No data record of requested type

I'd assume it is because of a proxy, but i tried to set up the corporate proxy with "curlSetOpt(.opts = list(proxy =" but it doesn't seem to work.

WillemPaling commented 11 years ago

I was able to get RCurl and HTTR connecting through the proxy, but not RGA. I might fork the repo and see if I can get it working. In my case I just want it using the windows proxy settings.

WillemPaling commented 11 years ago

I found that I could get it working if I changed all the HTTP calls to use HTTR instead of RCurl. I still had to manually specify my proxy settings, so I'll keep working to see if I can get it using the windows proxy settings instead.

@skardhamar — any reason not to use HTTR for all the HTTP calls instead of a mix of HTTR and RCurl? Is it just a matter of getting around to making the change? Or is RCurl better for some things?

MuqadderIqbal commented 9 years ago

Same issue here. Actually, I am unable to run the install_github("skardhamar/rga") command in RSTUDIO. I get > install_github("skardhamar/rga") Downloading github repo skardhamar/rga@master Error in function (type, msg, asError = TRUE) : couldn't connect to host

If I go directly to the Github page, I am able to manually download the zip. Any suggestions on how to fix this?

WillemPaling commented 9 years ago

I got around this problem behind a corporate proxy by installing CNTLM, then a setting R to use the open cntlm localhost proxy.

http://cntlm.sourceforge.net

joaolcorreia commented 9 years ago

Hi,

I've installed R in an Ubuntu, loaded library devtools and try to install rga. I'm getting this.

install_github("skardhamar/rga") Downloading github repo skardhamar/rga@master Error in function (type, msg, asError = TRUE) :

Any tips?

Thanks Joao