[Pkg-privacy-commits] [obfsproxy] 16/353: Various fixes to get SOCKS and proxy handlers working

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:01:33 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository obfsproxy.

commit d942a138298a4a10eba52f9d3b6bd1cf4bd6a8be
Author: Brandon Wiley <brandon at blanu.net>
Date:   Fri Jul 6 13:29:33 2012 -0500

    Various fixes to get SOCKS and proxy handlers working
---
 src/obfsproxy/framework/managed/client.py | 2 +-
 src/obfsproxy/framework/managed/server.py | 6 +++---
 src/obfsproxy/framework/proxy.py          | 9 ++++-----
 src/obfsproxy/framework/socks.py          | 3 +++
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/obfsproxy/framework/managed/client.py b/src/obfsproxy/framework/managed/client.py
index 03152d5..ad6cb07 100755
--- a/src/obfsproxy/framework/managed/client.py
+++ b/src/obfsproxy/framework/managed/client.py
@@ -46,7 +46,7 @@ class ManagedClient:
 
         client = DummyClient()
         self.handler.setTransport(client)
-        add_service(Service(self.handler, port=port))
+        add_service(Service(self.handler.handle, port=port))
 
 
 if __name__ == '__main__':
diff --git a/src/obfsproxy/framework/managed/server.py b/src/obfsproxy/framework/managed/server.py
index b8cbd5c..ad64a24 100755
--- a/src/obfsproxy/framework/managed/server.py
+++ b/src/obfsproxy/framework/managed/server.py
@@ -30,8 +30,8 @@ class ManagedServer:
         matchedTransports = init(self.supportedTransports)
         for transport in matchedTransports:
             try:
-                self.launchServer(transport, 8182)
-                reportSuccess(transport, ('127.0.0.1', 8182), None)
+                self.launchServer(transport, 8183)
+                reportSuccess(transport, ('127.0.0.1', 8183), None)
             except TransportLaunchException:
                 reportFailure(transport, 'Failed to launch')
         reportEnd()
@@ -45,7 +45,7 @@ class ManagedServer:
 
         server = DummyServer()
         self.handler.setTransport(server)
-        add_service(Service(self.handler, port=port))
+        add_service(Service(self.handler.handle, port=port))
 
 
 if __name__ == '__main__':
diff --git a/src/obfsproxy/framework/proxy.py b/src/obfsproxy/framework/proxy.py
index 46065b0..5927d61 100644
--- a/src/obfsproxy/framework/proxy.py
+++ b/src/obfsproxy/framework/proxy.py
@@ -6,6 +6,7 @@ from socket import inet_ntoa
 
 import monocle
 from monocle import _o, Return
+from monocle.stack.network import Client
 
 from pyptlib.util import encode
 
@@ -23,11 +24,9 @@ class ProxyHandler:
     def handle(self, conn):
         print 'connection'
         client = Client()
-        yield client.connect('blanu.net', 7051)
+        yield client.connect('blanu.net', 80)
 
-        coder = (yield handshake(client))
-
-        monocle.launch(pump, conn, client, coder.encrypt)
-        yield pump(client, conn, coder.decrypt)
+        monocle.launch(pump, conn, client, None)
+        yield pump(client, conn, None)
 
 
diff --git a/src/obfsproxy/framework/socks.py b/src/obfsproxy/framework/socks.py
index 57a32a6..6452552 100644
--- a/src/obfsproxy/framework/socks.py
+++ b/src/obfsproxy/framework/socks.py
@@ -6,6 +6,7 @@ from socket import inet_ntoa
 
 import monocle
 from monocle import _o, Return
+from monocle.stack.network import Client
 
 from pyptlib.util import encode
 
@@ -71,6 +72,8 @@ class SocksHandler:
         print 'sent response'
 
         (addr, port) = uncompact(dest)
+#        addr='127.0.0.1'
+#        port=8183
         print addr
         print port
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/obfsproxy.git



More information about the Pkg-privacy-commits mailing list