0

EDIT: Despite having confirmed that this error is ISP-related. I still do not understand why system curl works fine. (error in curl (R) occurs in any site)

EDIT: Currently after a ISP visit. It works fine with cable, but wifi functioning is limited to a ISP router. Error persists with wifi with a personal router or the ISP modem.

Could it be something related to closed ports? (Which would be closed only in the problematic ISP)

I am getting a normal result in system console for:

curl -I https://www.gnu.org/

However the curl package in R gives: (error using the problematic ISP only)

con <- curl("https://gnu.org")
readLines(con)
# Error in readLines(con) : 
# Timeout was reached: [gnu.org] Resolving timed out after 10000 milliseconds

The RCurl package works fine, but what I am trying to use requires curl (R)

Ferroao
  • 3,042
  • 28
  • 53
  • Check your OS firewall(s) and/or anti-virus software, often they permit some applications (processes) to access the internet and restrict others. If not that, check for proxies that may be configured for your command-line `curl` but not visible or apparent in R. – r2evans Mar 04 '21 at 22:01
  • firewall disabled. no proxies. I can suspect my ISP provider blocks something. Confirmed ISP of neighbor works fine. – Ferroao Mar 04 '21 at 22:47
  • Some websites might be wary of User-Agent, but I wouldn't suspect that of gnu.org ... however, ISPs with stateful inspection of passing packets might not be happy with it. I don't know. I don't know enough about curl to know the nuances, but it might be good to know the difference between `curl --version` and `curl::curl_version()`. – r2evans Mar 04 '21 at 22:51
  • 1
    confirmed problem is for any site, for this ISP – Ferroao Mar 04 '21 at 22:56
  • Have you tried forcing the user-agent for your `curl::curl(.)` call? If there's a difference, you can mimic the command-line user-agent within R. – r2evans Mar 05 '21 at 00:36
  • It seems that curl(R) works with libcurl, not curl? – Ferroao Mar 05 '21 at 02:29
  • Yes, I believe using DLLs for the underlying curl functionality is faster than exec'ing a binary. – r2evans Mar 05 '21 at 13:03
  • the user agent used by curl (system) is the same as libcurl? – Ferroao Mar 05 '21 at 13:59
  • I would assume so but I honestly do not know. You might use your command-line (working) `curl` to visit something like https://www.whatismybrowser.com/detect/what-is-my-user-agent to see what the command-line is using. Then, try to mimic it using something from https://jeroen.cran.dev/curl/articles/intro.html#setting-handle-options – r2evans Mar 05 '21 at 14:08

0 Answers0