Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bower calls blocked by corporate proxy

Tags:

bower

proxy

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

Relevant points:

  • 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.

Any ideas?

like image 863
LJW Avatar asked Feb 13 '14 09:02

LJW


4 Answers

Thanks @user3259967

This did the job.

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>/"
}

NOTICE the use of http:// in https-proxy

like image 99
Sohail Avatar answered Nov 02 '22 02:11

Sohail


The solution for me is this config .bowerrc

{
  "directory": "vendor",
  "registry": "http://bower.herokuapp.com",
  "proxy": "http://<user>:<pwd>@proxy.host.br:8080",
  "https-proxy": "http://<user>:<pwd>@proxy.host.br:8080",
  "strict-ssl": false
}

Using the http protocol in https-proxy plus registry entry with http protocol.

Remember to change 8080 port number to whatever is yours proxy server port.

like image 32
Ademir Mazer Jr - Nuno Avatar answered Nov 02 '22 01:11

Ademir Mazer Jr - Nuno


Are you behind a proxy?

Have you set up environment variables HTTP_PROXY and HTTPS_PROXY?

SET HTTP_PROXY=http://yourproxyserver:yourproxyport
SET HTTPS_PROXY=http://yourproxyserver:yourproxyport
like image 19
JamesClevenger Avatar answered Nov 02 '22 00:11

JamesClevenger


Try changing the registry value in your .bowerrc:

{
    "registry": "http://bower.herokuapp.com"
}
like image 14
hontas Avatar answered Nov 02 '22 00:11

hontas