gpt4 book ai didi

R curl fetch连接问题: time out reached

转载 作者:行者123 更新时间:2023-12-05 06:05:52 29 4
gpt4 key购买 nike

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

在Microsoft edge中直接访问上面的URL没有问题。

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

当我如上所述将超时专门设置为 60 秒时,代码永远运行,我不得不手动回调它。

> 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

我已经手动将我的 DNS 设置为 8.8.8.8。我在中国大陆,用VPN绕过GFW。

最佳答案

我引用这个article解决了这个问题并将 :(mylocalhostaddress) 添加到代理的末尾。希望它能帮助将来的人。谢谢你们。

关于R curl fetch连接问题: time out reached,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65930589/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com