【问题标题】:access plotly behind proxy在代理后面访问
【发布时间】:2014-09-05 14:08:07
【问题描述】:

我正在尝试使用 plotly 包制作我的 ggplot2 的交互式版本。当我从个人计算机上执行此操作时,它工作正常。 不幸的是,我正在工作,在代理后面的 Windows 机器上,它无法连接到 plotly 服务器。浏览代码源,我认为问题可能出在RCurl 中的postFrom 函数上。我tried adding the proxyoptions(RCurlOptions = list(proxy="http://proxyurl:8080")),但这似乎并没有改善情况。有已知的解决方法吗?

library(httr)
set_config(use_proxy(url="http://proxy.xxx.fr",port=8080,username="",password=""))
options('RCurlOptions'= c(options('RCurlOptions'), list(proxy = 'http://proxy.xxxx.fr:8080')))
library(plotly)
set_credentials_file(username="baptiste", api_key="xxxx")

require(plotly)

p2 <- qplot(1,1)
py <- plotly(username="baptiste")
out <- py$ggplotly(p2)
# Error in function (type, msg, asError = TRUE)  : couldn't connect to host

【问题讨论】:

    标签: r proxy plotly


    【解决方案1】:

    pub$makecall in plotly.R 会覆盖您的全局 RCurlOptions。我已经提交了一个拉取请求来解决这个问题。

    【讨论】:

      【解决方案2】:

      我认为如果你像这样设置你的 RCurl 选项:

      opts <- list(
        proxy         = "myweb.proxy.com", 
        proxyusername = "myproxyuser", 
        proxypassword = "myproxypassword", 
        proxyport     = 8080
      )
      
      options(RCurlOptions = opts)
      

      那么你应该能够连接到主机,至少这在我的工作代理后面对我有用。

      【讨论】:

      • 我实际上无法再测试这个了,因为我不再在这个工作场所工作了。另一个答案表明在情节方面有一个修复。
      猜你喜欢
      • 2020-11-11
      • 1970-01-01
      • 2015-09-15
      • 1970-01-01
      • 1970-01-01
      • 2011-12-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多