<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule">

<channel>
	<title>Nothing in particular &#187; proxy</title>
	<atom:link href="http://blogs.gnome.org/juanje/tag/proxy/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogs.gnome.org/juanje</link>
	<description>Juanje's thoughts about GNOME, FLOSS and more</description>
	<lastBuildDate>Wed, 03 Feb 2010 20:37:49 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<creativeCommons:license>http://creativecommons.org/licenses/by-sa/3.0/es/</creativeCommons:license>		<item>
		<title>Using git behind a proxy</title>
		<link>http://blogs.gnome.org/juanje/2009/07/17/git_behind_proxy/</link>
		<comments>http://blogs.gnome.org/juanje/2009/07/17/git_behind_proxy/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 12:58:46 +0000</pubDate>
		<dc:creator>juanje</dc:creator>
				<category><![CDATA[DVCS]]></category>
		<category><![CDATA[distros]]></category>
		<category><![CDATA[gnome]]></category>
		<category><![CDATA[guadalinex]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[socks]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blogs.gnome.org/juanje/?p=169</guid>
		<description><![CDATA[
div.paste {  padding: 10px 10px 10px 10px; font-size: 110%;  border: .5px solid #6d4c07; background-color: #f5ebd7; }
.c { color: #008800; font-style: italic } /* Comment */
.err { border: 1px solid #FF0000 } /* Error */
.k { color: #AA22FF; font-weight: bold } /* Keyword */
.o { color: #666666 } /* Operator */
.nv { color: #B8860B [...]]]></description>
			<content:encoded><![CDATA[<style>
div.paste {  padding: 10px 10px 10px 10px; font-size: 110%;  border: .5px solid #6d4c07; background-color: #f5ebd7; }
.c { color: #008800; font-style: italic } /* Comment */
.err { border: 1px solid #FF0000 } /* Error */
.k { color: #AA22FF; font-weight: bold } /* Keyword */
.o { color: #666666 } /* Operator */
.nv { color: #B8860B } /* Name.Variable */
.nb { color: #AA22FF } /* Name.Builtin */
</style>
<p>This is a simple recipe about how to use <b>git</b> behind a proxy.</p>
<p>Right now I&#8217;m working behind a very restrictive firewall and I can&#8217;t get any port I need open, so I use a <a href="http://en.wikipedia.org/wiki/SOCKS">proxy socks</a> for working with <i>git</i>,<i>bzr</i>,<i>jabber</i> and so on. I was looking for an easy way to use git with a proxy but I didn&#8217;t find easily the solution. After some researches a friend (<i>Roberto</i>) found the solution and we use it at work.</p>
<p>Let&#8217;s see it <img src='http://blogs.gnome.org/juanje/wp-content/mu-plugins/tango-smilies/tango/face-wink.png' alt=';-)' class='wp-smiley' /> </p>
<p>Just in case we don&#8217;t have it:</p>
<div class="paste">
<pre><span class="nv">$ </span>mkdir ~/bin
</pre>
</div>
<p></p>
<p>Now the interesting part, the <i>wrapper</i> for the proxy:</p>
<div class="paste">
<pre><span class="nv">$ </span>cat <span class="s">&lt;&lt;EOF&gt;&gt; ~/bin/proxy-wrapper</span>
<span class="c">#!/bin/sh</span>
<span class="c"># Put your own values</span>
<span class="nv">PROXY_IP</span><span class="o">=</span>10.0.0.80
<span class="nv">PROXY_PORT</span><span class="o">=</span>22000

nc -x<span class="k">${</span><span class="nv">PROXY_IP</span><span class="k">}</span>:<span class="k">${</span><span class="nv">PROXY_PORT</span><span class="k">}</span> -X5 <span class="nv">$*</span>

<span class="s">EOF</span>
<span class="nv">$ </span><span class="s">chmod +x ~/bin/proxy-wrapper</span>
</pre>
</div>
<p>Note that you&#8217;ll need to have installed <b>netcat</b> (the openbsd&#8217;s one: <i>netcat-openbsd</i>) to be able to use the command <b>nc</b> with the option <b>-x</b>.</p>
<p>Then you&#8217;ll have to be sure you have setted the <i>~/bin</i> directory on your <i>PATH</i> and then add the env variable <b>GIT_PROXY_COMMAND</b>. That variable will be used by <i>git</i> for doing pushes through <i>git</i> or <i>ssh</i> protocol:</p>
<p></p>
<div class="paste">
<pre><span class="nv">$ </span>cat <span class="s">&lt;&lt;EOF&gt;&gt; ~/.bashrc</span>
<span class="nb">export </span><span class="nv">PATH</span><span class="o">=</span>~/bin:<span class="s2">"${PATH}"</span>
<span class="nb">export </span><span class="nv">GIT_PROXY_COMMAND</span><span class="o">=</span>~/bin/proxy-wrapper
<span class="s">EOF</span>
</pre>
</div>
<p>Now you will be able to use git normally with no worries about the firewall, nat or whatever.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.gnome.org/juanje/2009/07/17/git_behind_proxy/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
	</channel>
</rss>
