## translation metadata
# Revision: $Revision$
# Translation-Priority: 4-optional

#include "head.wmi" TITLE="obfsproxy: Installation instructions" CHARSET="UTF-8"

<div id="content" class="clearfix">
  <div id="breadcrumbs">
    <a href="<page index>">Home &raquo; </a>
    <a href="<page projects/projects>">Projects &raquo; </a>
    <a href="<page projects/obfsproxy>">obfsproxy</a>
  </div>
  <div id="maincol">

    <!-- PUT CONTENT AFTER THIS TAG -->

    <h1 id="instructions">Obfsproxy Instructions</h1>

    <img src="$(IMGROOT)/obfsproxy_diagram.png" alt="client torrc"></a>

      <p>
        This is a guide for installing the Python version of obfsproxy. If
        you still have the C version, we recommend you to upgrade to the
        Python version!
      </p>

    <h3>Step 0: Install Python</h3>
    <br>

    <p>
      To setup obfsproxy you will need <code>Python</code> (>= 2.7),
      and <code>pip</code>. If you use Debian testing (or unstable),
      or a version of Ubuntu newer than Oneiric, this is easy:
    <p>

    <tt># apt-get install python2.7 python-pip python-dev build-essential</tt>


    <h3>Step 1: Install Tor</h3>
    <br>

    <p>
      You will also need a recent version of Tor (>= 0.2.4.1). We recommend you use
      <a href="<page docs/debian>#ubuntu">Tor's repositories for Debian/Ubuntu</a>
      or
      <a href="https://gitweb.torproject.org/tor.git">install Tor from git</a>.
    </p>

    <p>
    You need Tor 0.2.4.x because it knows how to automatically report
    your obfsproxy address to BridgeDB.
    </p>

    <h3>Step 2: Install obfsproxy</h3>
    <br>

    <p>
      If you have <code>pip</code>, installing <code>obfsproxy</code>
      and its dependencies should be a matter of a single command:
    </p>

    <tt># pip install obfsproxy</tt><br><br>

    <p>
    You will probably want to run the <em>pip install</em> command as
    root so that obfsproxy gets installed to /usr/local/bin.
    </p>
    <p>
    (Instead of using pip, you could also use <a
    href="https://gitweb.torproject.org/pluggable-transports/obfsproxy.git">the
    git repository</a> of obfsproxy if you feel more adventurous)
    </p>

    <h3>Step 3: Setup tor</h3>
    <br>

    <p>
      Now setup Tor.  Edit your /etc/tor/torrc to add:
    </p>

      <p>
        <tt>SocksPort 0</tt><br>
        <tt>ORPort 443 # or some other port if you already run a webserver/skype</tt><br>
        <tt>BridgeRelay 1</tt><br>
        <tt>Exitpolicy reject *:*</tt><br><br>

        <tt>## CHANGEME_1 -> provide a nickname for your bridge, can be anything you like</tt><br>
        <tt>#Nickname CHANGEME_1</tt><br>
        <tt>## CHANGEME_2 -> provide some email address so we can contact you if there's a problem</tt><br>
        <tt>#ContactInfo CHANGEME_2</tt><br><br>

        <tt>ServerTransportPlugin obfs3 exec /usr/local/bin/obfsproxy managed</tt><br>
      </p>

      <p>
        Don't forget to uncomment and edit the CHANGEME fields. Also,
        if you didn't install obfsproxy as root, you might have to
        change its path.
      </p>

      <h3>Step 4: Launch Tor and verify that it bootstraps</h3>
      <br>

      <p>
        Restart Tor to use the new configuration file. (Preface with sudo if
        needed.)
      </p>

      <tt># service tor restart</tt><br><br>

      <p>
        Now check /var/log/tor/log and you should see something like this:
      </p>

      <tt>Nov 05 16:40:45.000 [notice] We now have enough directory information to build circuits.</tt><br>
      <tt>Nov 05 16:40:45.000 [notice] Bootstrapped 80%: Connecting to the Tor network.</tt><br>
      <tt>Nov 05 16:40:46.000 [notice] Bootstrapped 85%: Finishing handshake with first hop.</tt><br>
      <tt>Nov 05 16:40:46.000 [notice] Bootstrapped 90%: Establishing a Tor circuit.</tt><br>
      <tt>Nov 05 16:40:48.000 [notice] Tor has successfully opened a circuit. Looks like client functionality is working.</tt><br>
      <tt>Nov 05 16:40:48.000 [notice] Bootstrapped 100%: Done.</tt><br><br>

      <p>
        If Tor is earlier in the bootstrapping phase, wait until it gets to 100%.
      </p>

      <h2>Step 5: Set up port forwarding if needed</h2>
      <br>

      <p>
        If you're behind a NAT/firewall, you'll need to make your bridge
        reachable from the outside world — both on the ORPort and the
        obfsproxy port. The ORPort is whatever you defined in step two
        above. To find your obfsproxy port, check your Tor logs for two
        lines similar to these:
      </p>

      <tt>Oct 05 20:00:41.000 [notice] Registered server transport 'obfs2' at '0.0.0.0:26821</tt><br>
      <tt>Oct 05 20:00:42.000 [notice] Registered server transport 'obfs3' at '0.0.0.0:40172</tt><br><br>

      <p>
        The last number in each line, in this case 26821 and 40172, are the
        TCP port numbers that you need to forward through your
        firewall. (This port is randomly chosen the first time Tor starts,
        but Tor will cache and reuse the same number in future runs.) If you
        want to change the number, use Tor 0.2.4.7-alpha or later, and set
        "ServerTransportListenAddr obfs2 0.0.0.0:26821" in your torrc.
      </p>

    <br>

  </div>
  <!-- END MAINCOL -->
  <div id = "sidecol">
#include "side.wmi"
#include "info.wmi"
  </div>
  <!-- END SIDECOL -->
</div>
<!-- END CONTENT -->
#include <foot.wmi>