4

I've got some problem with the network connection of R.

library(curl) req <- curl_fetch_memory("https://eu.httpbin.org/get?foo=123") Error in curl_fetch_memory("https://eu.httpbin.org/get?foo=123") : Timeout was reached: [eu.httpbin.org] Operation timed out after 10002 milliseconds with 0 out of 0 bytes received 

I've got no problem when directly access the URL above in Microsoft edge.

httr::GET("http://cran.r-project.org/Rlogo.jpg", config = httr::config(connecttimeout = 60)) 

And when I specifically set the timeout to be 60 seconds as above, the code ran forever and I had to manually call it back.

> sessionInfo() R version 4.0.3 (2020-10-10) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19042) Matrix products: default locale: [1] LC_COLLATE=Chinese (Simplified)_China.936 [2] LC_CTYPE=Chinese (Simplified)_China.936 [3] LC_MONETARY=Chinese (Simplified)_China.936 [4] LC_NUMERIC=C [5] LC_TIME=Chinese (Simplified)_China.936 attached base packages: [1] stats graphics grDevices utils datasets [6] methods base other attached packages: [1] curl_4.3 loaded via a namespace (and not attached): [1] compiler_4.0.3 tools_4.0.3 > curl_version() $version [1] "7.64.1" $ssl_version [1] "(OpenSSL/1.1.1a) Schannel" $libz_version [1] "1.2.11" $libssh_version [1] "libssh2/1.8.2" $libidn_version [1] NA $host [1] "x86_64-w64-mingw32" $protocols [1] "dict" "file" "ftp" "ftps" "gopher" [6] "http" "https" "imap" "imaps" "ldap" [11] "ldaps" "pop3" "pop3s" "rtsp" "scp" [16] "sftp" "smtp" "smtps" "telnet" "tftp" $ipv6 [1] TRUE $http2 [1] FALSE $idn [1] TRUE 

I've already manually set my DNS to 8.8.8.8. I'm in mainland China and I use VPN to bypass the GFW.

7
  • Hm, this might be a firewall/VPN thing: both work perfectly within a second on my machine as written :/ Commented Jan 28, 2021 at 3:31
  • Thank you very much. ^_^ Any more suggestions? Commented Jan 28, 2021 at 3:35
  • You could try traceroute tools from the command line (tracert on windows, traceroute on most others). I suspect that'll provide the same error and tell you where the problem is, but beyond that I'm not sure. If you do get the same error, you could ask an additional question leaving the R part behind. Commented Jan 28, 2021 at 3:40
  • Still doesn't work after turning down the firewall. Commented Jan 28, 2021 at 4:46
  • Thank you for your advice. Can't tracert either of the said URL or google.com. But mainland URL like baidu.com and weibo.com works. Commented Jan 28, 2021 at 4:48

1 Answer 1

1

I've solved this problem with reference to this article and by adding :(mylocalhostaddress) to the end of the proxy. Hope it helps somebody in the future. Thank you, guys.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.