Bower 呼叫被公司代理阻止 [英] Bower calls blocked by corporate proxy

查看:21
本文介绍了Bower 呼叫被公司代理阻止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将 Bower 用于网络应用程序,但发现自己遇到了某种代理问题:

I'm trying to use Bower for a web app, but find myself hitting some sort of proxy issues:

D:>bower search jquery
bower retry         Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 1.2s
bower retry         Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 2.5s
bower retry         Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 6.8s
bower retry         Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 15.1s
bower retry         Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 20.3s
bower ECONNRESET    Request to https://bower.herokuapp.com/packages/search/jquery failed: tunneling socket could not be established, cause=Parse Error

相关要点:

  • 我可以浏览到https://bower.herokuapp.com/packages/search/jquery返回一个完整的 json 响应.
  • 我可以使用 git 进行克隆,使用 git://协议和 http(s).
  • 我可以直接使用 NPM 而不会出现这些问题
  • 我已尝试使用 Fiddler 来确定被阻止的内容,但它没有检测到来自 Bower 命令的任何调用.我可以在 Fiddler 中看到来自 NPM 命令的调用.
  • 我搜索了 Bower 问题列表,看到了类似的问题,但他们要么没有解决方案,要么看起来与我的不太一样.
  • I can browse to https://bower.herokuapp.com/packages/search/jquery and it returns a full json response.
  • I can use git to clone, both using the git:// protocol and http(s).
  • I can use NPM directly without these issues
  • I've tried using Fiddler to determine what's being blocked, but it doesn't detect any calls from the Bower command. I can see calls from NPM commands in Fiddler.
  • I've searched the Bower issues list, seen similar issues, but they either have no solution or it doesn't seem quite the same as mine.

有什么想法吗?

推荐答案

感谢@user3259967

Thanks @user3259967

这就完成了工作.

我想补充一点,如果您使用需要进行身份验证的代理,您可以将用户名/密码添加到您的 .bowerrc 文件中.

I would like to add that if you are behind a proxy that needs to be authenticated, you can add the username/password to your .bowerrc file.

{
  "directory": "library",
  "registry": "http://bower.herokuapp.com",
  "proxy":"http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/",
  "https-proxy":"http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/"
}

注意在 https-proxy 中使用 http://

这篇关于Bower 呼叫被公司代理阻止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆