2

我正在尝试设置grunt-contrib-connect为我的 XHR 调用提供代理。我发现grunt-connect-proxy这似乎是我想要的。但我在不允许来自的请求node通过的公司防火墙后面。

我得到的错误是:

An error has occurred: {"code":"ETIMEDOUT","errno":"ETIMEDOUT","syscall":"connect"}

如何设置connect任务以使其通过公司防火墙?

4

1 回答 1

4

所以,我终于找到了怎么做。

connect : {
    server: {
        proxies: [
            {
                context: '/proxy',
                host: 'proxyhost', // e.g. someproxy.com
                port: 8080, // proxy port
                headers: {
                    Host: "example.com" // the real host you want to access
                }
            }
        ]
    }
}
于 2014-07-18T09:39:02.663 回答