Thursday, April 30, 2009

Installing a Rails plugin from GitHub through a firewall and proxy

I was working on a Ruby on Rails project today with Nigel from Able Technology, and we wanted to install a plugin from GitHub.

We had a few problems because of a corporate firewall and an http proxy server. Only port 80, http traffic was allowed.

To do this in OSX the following steps were necessary:

1. Set the htttp_proxy variable in the shell:

export http_proxy=http://our.proxy:our_port


if your proxy requires a username and password the command is:

export http_proxy=http://username:password@your.proxy:your_port


2. Run the import using http instead of the git protocol:

script/plugin install http://github.com/adamlogic/showoff.git

1 comment:

Anonymous said...

Hi Richard,

It's cheating the filters a bit so you need to be careful to keep in line with company policy but I came across http://proxytunnel.sourceforge.net/ a while ago and had a bit of a play - it seems to work well. I just have SSH running on ports 80 and 443 (via stunnel) of my server and most restrictive proxies give access to those ports. Of course once that's there you can use dynamic forwarding (-D) to tunnel anything through.

Cheers,

Tim