[tor-commits] [ooni-probe/master] Add obfsproxy support to BridgeT

art at torproject.org art at torproject.org
Fri Feb 10 14:18:21 UTC 2012


commit 2b72638b5f1afea23348def754ce24beb9c11c75
Author: Arturo Filastò <hellais at gmail.com>
Date:   Fri Feb 10 15:06:23 2012 +0100

    Add obfsproxy support to BridgeT
---
 refactor/tests/bridget.py |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/refactor/tests/bridget.py b/refactor/tests/bridget.py
index 71d210a..12e3fa1 100644
--- a/refactor/tests/bridget.py
+++ b/refactor/tests/bridget.py
@@ -38,11 +38,22 @@ class BridgeT(Plugoo):
         socksport = random.randint(49152, 65535)
         randomname = "tor_"+str(random.randint(0, 424242424242))
         datadir = "/tmp/" + randomname
-        torrc = """SocksPort %s
+        if bridge.startswith("obfs://"):
+            obfsbridge = bridge.split("/")[1]
+            torrc = """SocksPort %s
+UseBridges 1
+DataDirectory %s
+Bridge obfs2 %s
+ClientTransportPlugin obfs2 exec /usr/local/bin/obfsproxy --managed
+""" % (socksport, obfsbridge, datadir)
+
+        else:
+            torrc = """SocksPort %s
 UseBridges 1
 bridge %s
 DataDirectory %s
 """ % (socksport, bridge, datadir)
+
         try:
             f = open(randomname, "wb")
             f.write(torrc)





More information about the tor-commits mailing list