[Pkg-privacy-commits] [obfsproxy] 19/353: Fixes to get py-obfsproxy working with Tor

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 ed92e4fb36301676d1baef77c5c337b0a91208e2
Author: Brandon Wiley <brandon at blanu.net>
Date:   Wed Jul 18 12:30:22 2012 -0500

    Fixes to get py-obfsproxy working with Tor
---
 src/cli.py                        | 30 ++++++++++++++++++++++++++++--
 src/obfsproxy/framework/proxy.py  |  2 +-
 src/obfsproxy/framework/shared.py |  2 +-
 src/obfsproxy/framework/socks.py  |  2 +-
 4 files changed, 31 insertions(+), 5 deletions(-)

diff --git a/src/cli.py b/src/cli.py
index aa9b8af..e42c66c 100644
--- a/src/cli.py
+++ b/src/cli.py
@@ -1,8 +1,18 @@
 #!/usr/bin/python
 # -*- coding: utf-8 -*-
 
+import os
+import sys
+import logging
+
+logging.basicConfig(filename='/home/brandon/py-obfsproxy/pyobfslog.txt', loglevel=logging.DEBUG)
+logging.error('py-obfsproxy CLI loaded')
+logging.error('argv: '+str(sys.argv))
+
 import argparse
 
+sys.path.insert(0, os.path.realpath(os.path.join(os.path.dirname(__file__), "../../pyptlib/src")))
+
 from pyptlib.easy.util import checkClientMode
 
 from obfsproxy.framework.managed.server import ManagedServer
@@ -39,16 +49,32 @@ if __name__ == '__main__':
 #    parser.add_argument('protocol_options')
 #    parser.add_argument('protocol_name')
 
-    args = parser.parse_args()
+    logging.error('to parse')
+    try:
+        args = parser.parse_args()
+    except Exception as e:
+        logging.error('Exception parsing')
+        logging.error(str(e))
+    else:
+        logging.error('else')
+    logging.error('parsed')
+
+#    if args.log_file and len(args.log_file)>0:
+#	print('file logging: '+str(args.log_file[0]))
+#        logging.basicConfig(filename=args.log_file[0])
+
+    logging.error('py-obfsproxy CLI loaded2')
 
     daemon = None
     if args.managed:
         if checkClientMode():
+            logging.error('client')
             daemon = ManagedClient()
         else:
+            logging.error('server')
             daemon = ManagedServer()
     else:
-        print 'Unsupported mode. Only managed mode is available at the moment.'
+        logging.error('Unsupported mode. Only managed mode is available at the moment.')
 
 #        if dest:
 #            daemon = ExternalClient()
diff --git a/src/obfsproxy/framework/proxy.py b/src/obfsproxy/framework/proxy.py
index 5927d61..5059d58 100644
--- a/src/obfsproxy/framework/proxy.py
+++ b/src/obfsproxy/framework/proxy.py
@@ -8,7 +8,7 @@ import monocle
 from monocle import _o, Return
 from monocle.stack.network import Client
 
-from pyptlib.util import encode
+from obfsproxy.util import encode
 
 from obfsproxy.framework.shared import pump
 
diff --git a/src/obfsproxy/framework/shared.py b/src/obfsproxy/framework/shared.py
index 9cc2359..f50565b 100644
--- a/src/obfsproxy/framework/shared.py
+++ b/src/obfsproxy/framework/shared.py
@@ -6,7 +6,7 @@ from monocle import _o, Return
 
 from monocle.stack.network import ConnectionLost
 
-from pyptlib.util import encode
+from obfsproxy.util import encode
 
 
 @_o
diff --git a/src/obfsproxy/framework/socks.py b/src/obfsproxy/framework/socks.py
index 0abb038..114a28f 100644
--- a/src/obfsproxy/framework/socks.py
+++ b/src/obfsproxy/framework/socks.py
@@ -8,7 +8,7 @@ import monocle
 from monocle import _o, Return
 from monocle.stack.network import Client
 
-from pyptlib.util import encode
+from obfsproxy.util import encode
 
 from obfsproxy.framework.shared import pump
 

-- 
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