[tor-commits] [ooni-probe/master] Add support for using txsocksx inside of oonibclient.

art at torproject.org art at torproject.org
Wed Nov 6 09:12:44 UTC 2013


commit 4bfe78a135a7393bbbdb004e278de7843f6eb1e4
Author: Arturo Filastò <art at fuffa.org>
Date:   Mon Sep 16 12:28:39 2013 +0200

    Add support for using txsocksx inside of oonibclient.
---
 ooni/deck.py        |    1 -
 ooni/oonibclient.py |    8 +++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/ooni/deck.py b/ooni/deck.py
index 98d90e0..c6adac6 100644
--- a/ooni/deck.py
+++ b/ooni/deck.py
@@ -3,7 +3,6 @@
 from ooni.nettest import NetTestLoader
 from ooni.settings import config
 from ooni.utils import log
-from ooni.utils.txagentwithsocks import Agent
 from ooni import errors as e
 
 from twisted.internet import reactor, defer
diff --git a/ooni/oonibclient.py b/ooni/oonibclient.py
index 6be7c44..555d99c 100644
--- a/ooni/oonibclient.py
+++ b/ooni/oonibclient.py
@@ -4,8 +4,9 @@ import json
 from hashlib import sha256
 
 from twisted.internet import defer, reactor
+from twisted.internet.endpoints import TCP4ClientEndpoint
 
-from ooni.utils.txagentwithsocks import Agent
+from txsocksx.http import SOCKS5Agent
 
 from ooni.deck import Deck, InputFile
 from ooni import errors as e
@@ -46,8 +47,9 @@ class OONIBClient(object):
 
     def __init__(self, address):
         self.address = address
-        self.agent = Agent(reactor, sockshost="127.0.0.1", 
-                           socksport=config.tor.socks_port)
+        self.agent = SOCKS5Agent(reactor,
+                proxyEndpoint=TCP4ClientEndpoint(reactor, '127.0.0.1',
+                    config.tor.socks_port))
 
     def _request(self, method, urn, genReceiver, bodyProducer=None):
         attempts = 0





More information about the tor-commits mailing list