[Pkg-privacy-commits] [pyptlib] 23/136: Removed files which are not in py-obfsproxy
Ximin Luo
infinity0 at moszumanska.debian.org
Sat Aug 22 13:25:02 UTC 2015
This is an automated email from the git hooks/post-receive script.
infinity0 pushed a commit to branch master
in repository pyptlib.
commit 9a090b155a850e0736d98721c964658183581aec
Author: Brandon Wiley <brandon at blanu.net>
Date: Mon Jun 25 15:07:30 2012 -0500
Removed files which are not in py-obfsproxy
---
src/pyptlib/cli/obfsproxy.py | 36 ---------------
src/pyptlib/framework/__init__.py | 0
src/pyptlib/framework/daemon.py | 52 ----------------------
src/pyptlib/framework/external/__init__.py | 0
src/pyptlib/framework/external/client.py | 63 --------------------------
src/pyptlib/framework/external/server.py | 62 --------------------------
src/pyptlib/framework/loopback.py | 64 ---------------------------
src/pyptlib/framework/managed/__init__.py | 0
src/pyptlib/framework/managed/client.py | 63 --------------------------
src/pyptlib/framework/managed/server.py | 62 --------------------------
src/pyptlib/framework/proxy.py | 27 ------------
src/pyptlib/framework/shared.py | 47 --------------------
src/pyptlib/framework/socks.py | 71 ------------------------------
src/pyptlib/manager/__init__.py | 0
src/pyptlib/manager/clientManager.py | 14 ------
src/pyptlib/manager/manager.py | 17 -------
src/pyptlib/manager/serverManager.py | 16 -------
src/pyptlib/transports/__init__.py | 0
src/pyptlib/transports/dummy.py | 14 ------
src/pyptlib/transports/rot13.py | 22 ---------
20 files changed, 630 deletions(-)
diff --git a/src/pyptlib/cli/obfsproxy.py b/src/pyptlib/cli/obfsproxy.py
deleted file mode 100644
index e2d81bf..0000000
--- a/src/pyptlib/cli/obfsproxy.py
+++ /dev/null
@@ -1,36 +0,0 @@
-import argparse
-
-from pyptlib.framework.server import ManagedServer
-from pyptlib.framework.client import ManagedClient
-
-protocols=['dummy', 'rot13']
-
-if __name__=='__main__':
- parser=argparse.ArgumentParser(description="* Available protocols: "+(' '.join(protocols)))
- parser.add_argument('--log-file', nargs=1, help='set logfile')
- parser.add_argument('--log-min-severity', nargs=1, default='notice', choices=['warn', 'notice', 'info', 'debug'], help='set minimum logging severity (default: %(default)s)')
- parser.add_argument('--no-log', action='store_false', default=True, help='disable logging')
- parser.add_argument('--no-safe-logging', action='store_false', default=True, help='disable safe (scrubbed address) logging')
- parser.add_argument('--managed', action='store_true', default=False, help='enabled managed mode, for use when called by tor')
- parser.add_argument('--dest', nargs=1, help='set destination, enable client mode instead of server mode')
-
- parser.add_argument('obfsproxy_args')
- parser.add_argument('protocol_name')
- parser.add_argument('protocol_args')
- parser.add_argument('protocol_options')
- parser.add_argument('protocol_name')
-
- args = parser.parse_args()
-
- print(args)
-
- if managed:
- if dest:
- client=ManagedClient()
- else:
- server=ManagedServer()
- else:
- if dest:
- client=ExternalClient()
- else:
- server=ExternalServer()
diff --git a/src/pyptlib/framework/__init__.py b/src/pyptlib/framework/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/src/pyptlib/framework/daemon.py b/src/pyptlib/framework/daemon.py
deleted file mode 100644
index cc55605..0000000
--- a/src/pyptlib/framework/daemon.py
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-import time
-
-from struct import unpack
-from socket import inet_ntoa
-
-import monocle
-from monocle import _o, Return
-monocle.init('tornado')
-
-from monocle.stack import eventloop
-from monocle.stack.network import add_service, Service, Client, ConnectionLost
-from pyptlib.framework.loopback import FakeSocket
-
-from pyptlib.framework.shared import *
-from pyptlib.framework.socks import *
-
-class Daemon:
- config=None
- handler=None
-
- supportedTransportVersion='1'
- supportedTransport='dummy'
-
- def __init__(self, configManager, handler):
- self.config=configManager
- self.handler=handler
-
- if self.config.checkManagedTransportVersion(self.supportedTransportVersion):
- self.config.writeVersion(self.supportedTransportVersion)
- else:
- self.config.writeVersionError()
- raise UnsupportedManagedTransportVersionException()
-
- if not self.config.checkTransportEnabled(self.supportedTransport):
- raise NoSupportedTransportsException()
-
- def run(self):
- eventloop.run()
-
-class UnsupportedManagedTransportVersionException(Exception):
- pass
-
-class NoSupportedTransportsException(Exception):
- pass
-
-class TransportLaunchException(Exception):
- def __init__(self, message):
- self.message=message
-
\ No newline at end of file
diff --git a/src/pyptlib/framework/external/__init__.py b/src/pyptlib/framework/external/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/src/pyptlib/framework/external/client.py b/src/pyptlib/framework/external/client.py
deleted file mode 100755
index e60cd63..0000000
--- a/src/pyptlib/framework/external/client.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python -u
-
-import os
-import sys
-
-import argparse
-
-from struct import unpack
-from socket import inet_ntoa
-
-import monocle
-from monocle import _o, Return
-monocle.init('tornado')
-
-from monocle.stack import eventloop
-from monocle.stack.network import add_service, Service, Client, ConnectionLost
-from pyptlib.framework.loopback import FakeSocket
-
-from pyptlib.framework.socks import SocksHandler
-
-from pyptlib.config.config import EnvException
-from pyptlib.config.client import ClientConfig
-from pyptlib.framework.daemon import *
-
-from pyptlib.transports.dummy import DummyClient
-
-class ManagedClient(Daemon):
- def __init__(self):
- try:
- Daemon.__init__(self, ClientConfig(), SocksHandler())
- except EnvException:
- print('error 0')
- return
- except UnsupportedManagedTransportVersionException:
- print('error 1')
- return
- except NoSupportedTransportsException:
- print('error 2')
- return
-
- try:
- self.launchClient(self.supportedTransport, 8182)
- self.config.writeMethod(self.supportedTransport, 5, ('127.0.0.1', 8182), None, None)
- except TransportLaunchException as e:
- print('error 3')
- self.config.writeMethodError(self.supportedTransport, e.message)
-
- self.config.writeMethodEnd()
-
- self.run()
-
- def launchClient(self, name, port):
- if name!=self.supportedTransport:
- raise TransportLaunchException('Tried to launch unsupported transport %s' % (name))
-
- client=DummyClient()
- self.handler.setTransport(client)
- add_service(Service(self.handler, port=port))
-
-if __name__=='__main__':
- sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
- server=ManagedClient()
-
\ No newline at end of file
diff --git a/src/pyptlib/framework/external/server.py b/src/pyptlib/framework/external/server.py
deleted file mode 100755
index 08b2e09..0000000
--- a/src/pyptlib/framework/external/server.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env python -u
-
-import os
-import sys
-
-from struct import unpack
-from socket import inet_ntoa
-
-import monocle
-from monocle import _o, Return
-monocle.init('tornado')
-
-from monocle.stack import eventloop
-from monocle.stack.network import add_service, Service, Client
-
-from pyptlib.framework.shared import pump
-
-from pyptlib.config.config import EnvException
-from pyptlib.config.server import ServerConfig, MethodOptions
-from pyptlib.framework.daemon import *
-
-from pyptlib.framework.proxy import ProxyHandler
-
-from pyptlib.transports.dummy import DummyServer
-
-class ManagedServer(Daemon):
- def __init__(self):
- try:
- Daemon.__init__(self, ServerConfig(), ProxyHandler())
- except EnvException:
- print('error 0')
- return
- except UnsupportedManagedTransportVersionException:
- print('error 1')
- return
- except NoSupportedTransportsException:
- print('error 2')
- return
-
- try:
- self.launchServer(self.supportedTransport, 8182)
- self.config.writeMethod(self.supportedTransport, ('127.0.0.1', 8182), MethodOptions())
- except TransportLaunchException as e:
- print('error 3')
- self.config.writeMethodError(self.supportedTransport, e.message)
-
- self.config.writeMethodEnd()
-
- self.run()
-
- def launchServer(self, name, port):
- if name!=self.supportedTransport:
- raise TransportLaunchException('Tried to launch unsupported transport %s' % (name))
-
- client=DummyServer()
- self.handler.setTransport(client)
- add_service(Service(self.handler, port=port))
-
-if __name__=='__main__':
- sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
- server=ManagedServer()
-
\ No newline at end of file
diff --git a/src/pyptlib/framework/loopback.py b/src/pyptlib/framework/loopback.py
deleted file mode 100644
index ecdb4d3..0000000
--- a/src/pyptlib/framework/loopback.py
+++ /dev/null
@@ -1,64 +0,0 @@
-import monocle
-from monocle import _o
-monocle.init('tornado')
-
-from monocle.core import Callback, Return
-from monocle.stack import eventloop
-
-from monocle.stack.network import Connection, ConnectionLost
-from monocle.experimental import Channel
-
-buffsize=1024
-
-class FakeSocket(object):
- def __init__(self, a=None, b=None):
- if a==None:
- self.a=Channel(buffsize)
- else:
- self.a=a
- if b==None:
- self.b=Channel(buffsize)
- else:
- self.b=b
-
- self.inBuff=b''
- self.outBuff=b''
-
- def invert(self):
- return FakeSocket(a=self.b, b=self.a)
-
- @_o
- def read(self, x):
- while len(self.inBuff)<x:
- data=yield self.a.recv()
- if data:
- self.inBuff=self.inBuff+data
- else:
- yield ConnectionLost()
-
- data=self.inBuff[:x]
- self.inBuff=self.inBuff[x:]
-
- yield Return(data)
-
- @_o
- def read_some(self):
- if len(self.inBuff)>0:
- data=self.inBuff
- self.inBuff=b''
- yield Return(data)
- else:
- data=b''
- while len(data)==0:
- data=yield self.a.recv()
- if data:
- yield Return(data)
- else:
- yield ConnectionLost()
-
- @_o
- def write(self, bs):
- yield self.b.send(bs)
-
- def close(self):
- yield self.b.send(None)
diff --git a/src/pyptlib/framework/managed/__init__.py b/src/pyptlib/framework/managed/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/src/pyptlib/framework/managed/client.py b/src/pyptlib/framework/managed/client.py
deleted file mode 100755
index e60cd63..0000000
--- a/src/pyptlib/framework/managed/client.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python -u
-
-import os
-import sys
-
-import argparse
-
-from struct import unpack
-from socket import inet_ntoa
-
-import monocle
-from monocle import _o, Return
-monocle.init('tornado')
-
-from monocle.stack import eventloop
-from monocle.stack.network import add_service, Service, Client, ConnectionLost
-from pyptlib.framework.loopback import FakeSocket
-
-from pyptlib.framework.socks import SocksHandler
-
-from pyptlib.config.config import EnvException
-from pyptlib.config.client import ClientConfig
-from pyptlib.framework.daemon import *
-
-from pyptlib.transports.dummy import DummyClient
-
-class ManagedClient(Daemon):
- def __init__(self):
- try:
- Daemon.__init__(self, ClientConfig(), SocksHandler())
- except EnvException:
- print('error 0')
- return
- except UnsupportedManagedTransportVersionException:
- print('error 1')
- return
- except NoSupportedTransportsException:
- print('error 2')
- return
-
- try:
- self.launchClient(self.supportedTransport, 8182)
- self.config.writeMethod(self.supportedTransport, 5, ('127.0.0.1', 8182), None, None)
- except TransportLaunchException as e:
- print('error 3')
- self.config.writeMethodError(self.supportedTransport, e.message)
-
- self.config.writeMethodEnd()
-
- self.run()
-
- def launchClient(self, name, port):
- if name!=self.supportedTransport:
- raise TransportLaunchException('Tried to launch unsupported transport %s' % (name))
-
- client=DummyClient()
- self.handler.setTransport(client)
- add_service(Service(self.handler, port=port))
-
-if __name__=='__main__':
- sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
- server=ManagedClient()
-
\ No newline at end of file
diff --git a/src/pyptlib/framework/managed/server.py b/src/pyptlib/framework/managed/server.py
deleted file mode 100755
index 08b2e09..0000000
--- a/src/pyptlib/framework/managed/server.py
+++ /dev/null
@@ -1,62 +0,0 @@
-#!/usr/bin/env python -u
-
-import os
-import sys
-
-from struct import unpack
-from socket import inet_ntoa
-
-import monocle
-from monocle import _o, Return
-monocle.init('tornado')
-
-from monocle.stack import eventloop
-from monocle.stack.network import add_service, Service, Client
-
-from pyptlib.framework.shared import pump
-
-from pyptlib.config.config import EnvException
-from pyptlib.config.server import ServerConfig, MethodOptions
-from pyptlib.framework.daemon import *
-
-from pyptlib.framework.proxy import ProxyHandler
-
-from pyptlib.transports.dummy import DummyServer
-
-class ManagedServer(Daemon):
- def __init__(self):
- try:
- Daemon.__init__(self, ServerConfig(), ProxyHandler())
- except EnvException:
- print('error 0')
- return
- except UnsupportedManagedTransportVersionException:
- print('error 1')
- return
- except NoSupportedTransportsException:
- print('error 2')
- return
-
- try:
- self.launchServer(self.supportedTransport, 8182)
- self.config.writeMethod(self.supportedTransport, ('127.0.0.1', 8182), MethodOptions())
- except TransportLaunchException as e:
- print('error 3')
- self.config.writeMethodError(self.supportedTransport, e.message)
-
- self.config.writeMethodEnd()
-
- self.run()
-
- def launchServer(self, name, port):
- if name!=self.supportedTransport:
- raise TransportLaunchException('Tried to launch unsupported transport %s' % (name))
-
- client=DummyServer()
- self.handler.setTransport(client)
- add_service(Service(self.handler, port=port))
-
-if __name__=='__main__':
- sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
- server=ManagedServer()
-
\ No newline at end of file
diff --git a/src/pyptlib/framework/proxy.py b/src/pyptlib/framework/proxy.py
deleted file mode 100644
index 68d9a16..0000000
--- a/src/pyptlib/framework/proxy.py
+++ /dev/null
@@ -1,27 +0,0 @@
-from struct import unpack
-from socket import inet_ntoa
-
-import monocle
-from monocle import _o, Return
-
-from pyptlib.util import encode
-
-from pyptlib.framework.shared import pump
-
-class ProxyHandler:
- transport=None
-
- def setTransport(self, transport):
- self.transport=transport
-
- @_o
- def handle(self, conn):
- print('connection')
- client = Client()
- yield client.connect('blanu.net', 7051)
-
- coder=yield handshake(client)
-
- monocle.launch(pump, conn, client, coder.encrypt)
- yield pump(client, conn, coder.decrypt)
-
diff --git a/src/pyptlib/framework/shared.py b/src/pyptlib/framework/shared.py
deleted file mode 100644
index 274b825..0000000
--- a/src/pyptlib/framework/shared.py
+++ /dev/null
@@ -1,47 +0,0 @@
-import monocle
-from monocle import _o, Return
-
-from monocle.stack.network import ConnectionLost
-
-from pyptlib.util import encode
-
- at _o
-def pump(input, output, transform, debug=False):
- while True:
- try:
- message = yield input.read_some()
-# message=yield input.read(1)
- if not message or len(message)==0:
- print('0 from '+str(input)+' '+str(type(message)))
- raise(Exception())
-# message=yield input.read(1)
- if debug:
- print('receive '+str(len(message)))
- except ConnectionLost:
- print('Client connection closed')
- output.close()
- break
- except IOError:
- output.close()
- break
-
- if transform:
- message=yield transform(message)
-
- if debug:
- print('sending '+str(len(message)))
- try:
- yield output.write(message)
- except ConnectionLost:
- print('Connection lost')
- input.close()
- return
- except IOError:
- print('IOError')
- input.close()
- return
- except Exception, e:
- print('Exception')
- print(e)
- input.close()
- return
diff --git a/src/pyptlib/framework/socks.py b/src/pyptlib/framework/socks.py
deleted file mode 100644
index c5659f0..0000000
--- a/src/pyptlib/framework/socks.py
+++ /dev/null
@@ -1,71 +0,0 @@
-from struct import unpack
-from socket import inet_ntoa
-
-import monocle
-from monocle import _o, Return
-
-from pyptlib.util import encode
-
-from pyptlib.framework.shared import pump
-
-def uncompact(x):
- ip, port = unpack("!4sH", x)
- return inet_ntoa(ip), port
-
- at _o
-def readHandshake(input):
- version=yield input.read(1)
- print('version: '+encode(str(version)))
- nauth=yield input.read(1)
- nauth=unpack('B', nauth)[0]
- auths=[]
- for x in range(nauth):
- auth=yield input.read(1)
- auth=unpack('B', auth)[0]
- auths.append(auth)
-
- at _o
-def sendHandshake(output):
- yield output.write(b"\x05\x00")
-
- at _o
-def readRequest(input):
- version=yield input.read(1)
- command=yield input.read(1)
- reserved=yield input.read(1)
- addrtype=yield input.read(1)
- dest=yield input.read(6)
-
- yield Return(dest)
-
- at _o
-def sendResponse(dest, output):
- yield output.write(b"\x05\x00\x00\x01"+dest)
-
-class SocksHandler:
- transport=None
-
- def setTransport(self, transport):
- self.transport=transport
-
- @_o
- def handle(self, conn):
- print('handle_socks')
- yield readHandshake(conn)
- print('read handshake')
- yield sendHandshake(conn)
- print('send handshake')
- dest=yield readRequest(conn)
- print('read request: '+str(dest))
- yield sendResponse(dest, conn)
- print('sent response')
-
- addr, port=uncompact(dest)
- print(addr)
- print(port)
-
- client = Client()
- yield client.connect(addr, port)
- print('connected '+str(addr)+', '+str(port))
- monocle.launch(pump, conn, client, None)
- yield pump(client, conn, None)
diff --git a/src/pyptlib/manager/__init__.py b/src/pyptlib/manager/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/src/pyptlib/manager/clientManager.py b/src/pyptlib/manager/clientManager.py
deleted file mode 100644
index 8ce6a0c..0000000
--- a/src/pyptlib/manager/clientManager.py
+++ /dev/null
@@ -1,14 +0,0 @@
-import os
-
-from pyptlib.manager.manager import Manager
-
-class ClientManager(Manager):
- def __init__(self):
- Manager.__init__(self)
-
- os.environ['TOR_PT_CLIENT_TRANSPORTS']='dummy'
-
-if __name__=='__main__':
- manager=ClientManager()
- manager.launch('src/pyptlib/framework/client.py')
-
\ No newline at end of file
diff --git a/src/pyptlib/manager/manager.py b/src/pyptlib/manager/manager.py
deleted file mode 100644
index b5f0ee9..0000000
--- a/src/pyptlib/manager/manager.py
+++ /dev/null
@@ -1,17 +0,0 @@
-import os
-import sys
-import subprocess
-
-class Manager:
- def __init__(self):
- os.environ['TOR_PT_STATE_LOCATION']='/'
- os.environ['TOR_PT_MANAGED_TRANSPORT_VER']='1'
-
- def launch(self, path):
- p=subprocess.Popen(['python', '-u', path], stdout=subprocess.PIPE)
- line=p.stdout.readline().strip()
- while line!=None and line !='':
- print(str(line))
- sys.stdout.flush()
- line=p.stdout.readline().strip()
- print('Done!')
diff --git a/src/pyptlib/manager/serverManager.py b/src/pyptlib/manager/serverManager.py
deleted file mode 100644
index a287ea7..0000000
--- a/src/pyptlib/manager/serverManager.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import os
-
-from pyptlib.manager.manager import Manager
-
-class ServerManager(Manager):
- def __init__(self):
- Manager.__init__(self)
-
- os.environ['TOR_PT_EXTENDED_SERVER_PORT']='127.0.0.1:22211'
- os.environ['TOR_PT_ORPORT']='127.0.0.1:43210'
- os.environ['TOR_PT_SERVER_BINDADDR']='dummy-127.0.0.1:46466'
- os.environ['TOR_PT_SERVER_TRANSPORTS']='dummy'
-
-if __name__=='__main__':
- manager=ServerManager()
- manager.launch('src/pyptlib/framework/server.py')
diff --git a/src/pyptlib/transports/__init__.py b/src/pyptlib/transports/__init__.py
deleted file mode 100644
index e69de29..0000000
diff --git a/src/pyptlib/transports/dummy.py b/src/pyptlib/transports/dummy.py
deleted file mode 100644
index 06473f5..0000000
--- a/src/pyptlib/transports/dummy.py
+++ /dev/null
@@ -1,14 +0,0 @@
-class DummyClient:
- def encode(self, data):
- return data
-
- def decode(self, data):
- return data
-
-class DummyServer:
- def encode(self, data):
- return data
-
- def decode(self, data):
- return data
-
diff --git a/src/pyptlib/transports/rot13.py b/src/pyptlib/transports/rot13.py
deleted file mode 100644
index a050b8e..0000000
--- a/src/pyptlib/transports/rot13.py
+++ /dev/null
@@ -1,22 +0,0 @@
-def rot13(data):
- for x in range(len(data)):
- ascii=ord(data[x])
- if ascii>=97 and ascii<=122: # a-z
- data[x]=(((ascii-97)+13)%26)+97
- elif ascii>=65 and ascii<=90: # A-Z
- data[x]=(((ascii-65)+13)%26)+65
- return data
-
-class Rot13Client:
- def encode(self, data):
- return rot13(data)
-
- def decode(self, data):
- return rot13(data)
-
-class Rot13Server:
- def encode(self, data):
- return rot13(data)
-
- def decode(self, data):
- return rot13(data)
\ No newline at end of file
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/pyptlib.git
More information about the Pkg-privacy-commits
mailing list