diff options
Diffstat (limited to 'python-client')
| -rw-r--r-- | python-client/tcprelay.py | 3 | ||||
| -rw-r--r-- | python-client/usbmux.py | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/python-client/tcprelay.py b/python-client/tcprelay.py index c49d708..2874ae1 100644 --- a/python-client/tcprelay.py +++ b/python-client/tcprelay.py | |||
| @@ -68,7 +68,7 @@ class SocketRelay(object): | |||
| 68 | class TCPRelay(SocketServer.BaseRequestHandler): | 68 | class TCPRelay(SocketServer.BaseRequestHandler): |
| 69 | def handle(self): | 69 | def handle(self): |
| 70 | print "Incoming connection to %d"%self.server.server_address[1] | 70 | print "Incoming connection to %d"%self.server.server_address[1] |
| 71 | mux = usbmux.USBMux() | 71 | mux = usbmux.USBMux(options.sockpath) |
| 72 | print "Waiting for devices..." | 72 | print "Waiting for devices..." |
| 73 | if not mux.devices: | 73 | if not mux.devices: |
| 74 | mux.process(1.0) | 74 | mux.process(1.0) |
| @@ -100,6 +100,7 @@ HOST = "localhost" | |||
| 100 | parser = OptionParser(usage="usage: %prog [OPTIONS] RemotePort[:LocalPort] [RemotePort[:LocalPort]]...") | 100 | parser = OptionParser(usage="usage: %prog [OPTIONS] RemotePort[:LocalPort] [RemotePort[:LocalPort]]...") |
| 101 | parser.add_option("-t", "--threaded", dest='threaded', action='store_true', default=False, help="use threading to handle multiple connections at once") | 101 | parser.add_option("-t", "--threaded", dest='threaded', action='store_true', default=False, help="use threading to handle multiple connections at once") |
| 102 | parser.add_option("-b", "--bufsize", dest='bufsize', action='store', metavar='KILOBYTES', type='int', default=128, help="specify buffer size for socket forwarding") | 102 | parser.add_option("-b", "--bufsize", dest='bufsize', action='store', metavar='KILOBYTES', type='int', default=128, help="specify buffer size for socket forwarding") |
| 103 | parser.add_option("-s", "--socket", dest='sockpath', action='store', metavar='PATH', type='str', default=None, help="specify the path of the usbmuxd socket") | ||
| 103 | 104 | ||
| 104 | options, args = parser.parse_args() | 105 | options, args = parser.parse_args() |
| 105 | 106 | ||
diff --git a/python-client/usbmux.py b/python-client/usbmux.py index 8b0270d..47112d3 100644 --- a/python-client/usbmux.py +++ b/python-client/usbmux.py | |||
| @@ -214,7 +214,7 @@ class USBMux(object): | |||
| 214 | if sys.platform == 'darwin': | 214 | if sys.platform == 'darwin': |
| 215 | socketpath = "/var/run/usbmuxd" | 215 | socketpath = "/var/run/usbmuxd" |
| 216 | else: | 216 | else: |
| 217 | socketpath = "/tmp/usbmuxd" | 217 | socketpath = "/var/run/usbmuxd" |
| 218 | self.socketpath = socketpath | 218 | self.socketpath = socketpath |
| 219 | self.listener = MuxConnection(socketpath, BinaryProtocol) | 219 | self.listener = MuxConnection(socketpath, BinaryProtocol) |
| 220 | try: | 220 | try: |
