nabla-c0d3 / multcprelay Goto Github PK
View Code? Open in Web Editor NEWtcprelay.py with support for multiple iDevices
tcprelay.py with support for multiple iDevices
Hello,
It appears that this code, through the virtue of polling only 3 times https://github.com/nabla-c0d3/multcprelay/blob/master/tcprelay.py#L90 will only ever find three idevices even if more are available. I have confirmed this behavior by modifying the code to call process more times, and each time it finds more devices
python /opt/multcprelay-master/tcprelay.py -t 22:5000 -u 3651d993a87da228a7453e465186a9d5f93fc38d
Forwarding local port 5000 to remote port 22
Incoming connection to 5000
Waiting for devices...
Devices:
<MuxDevice: ID 382 ProdID 0x12a8 Serial 'e89e3a7dae988a087d1b640f1807bc6347f36046' Location 0x14720000>
Devices:
<MuxDevice: ID 382 ProdID 0x12a8 Serial 'e89e3a7dae988a087d1b640f1807bc6347f36046' Location 0x14720000>
<MuxDevice: ID 381 ProdID 0x12a8 Serial '5c632c0075c7becca705b83382a716a58ff6737a' Location 0x14630000>
Devices:
<MuxDevice: ID 382 ProdID 0x12a8 Serial 'e89e3a7dae988a087d1b640f1807bc6347f36046' Location 0x14720000>
<MuxDevice: ID 381 ProdID 0x12a8 Serial '5c632c0075c7becca705b83382a716a58ff6737a' Location 0x14630000>
<MuxDevice: ID 380 ProdID 0x12a8 Serial 'ee97cdec1c7c706068425fc4f6de3179a1d13782' Location 0x14610000>
Devices:
<MuxDevice: ID 382 ProdID 0x12a8 Serial 'e89e3a7dae988a087d1b640f1807bc6347f36046' Location 0x14720000>
<MuxDevice: ID 381 ProdID 0x12a8 Serial '5c632c0075c7becca705b83382a716a58ff6737a' Location 0x14630000>
<MuxDevice: ID 380 ProdID 0x12a8 Serial 'ee97cdec1c7c706068425fc4f6de3179a1d13782' Location 0x14610000>
<MuxDevice: ID 376 ProdID 0x12a8 Serial 'f687347fb37bf8121a4e04b7ecb8dba5894e68a6' Location 0x14230000>
Devices:
<MuxDevice: ID 382 ProdID 0x12a8 Serial 'e89e3a7dae988a087d1b640f1807bc6347f36046' Location 0x14720000>
<MuxDevice: ID 381 ProdID 0x12a8 Serial '5c632c0075c7becca705b83382a716a58ff6737a' Location 0x14630000>
<MuxDevice: ID 380 ProdID 0x12a8 Serial 'ee97cdec1c7c706068425fc4f6de3179a1d13782' Location 0x14610000>
<MuxDevice: ID 376 ProdID 0x12a8 Serial 'f687347fb37bf8121a4e04b7ecb8dba5894e68a6' Location 0x14230000>
<MuxDevice: ID 375 ProdID 0x12a8 Serial '74e91e5d81d623b5cdbac86a75713553d3c0a86b' Location 0x14620000>
Devices:
<MuxDevice: ID 382 ProdID 0x12a8 Serial 'e89e3a7dae988a087d1b640f1807bc6347f36046' Location 0x14720000>
<MuxDevice: ID 381 ProdID 0x12a8 Serial '5c632c0075c7becca705b83382a716a58ff6737a' Location 0x14630000>
<MuxDevice: ID 380 ProdID 0x12a8 Serial 'ee97cdec1c7c706068425fc4f6de3179a1d13782' Location 0x14610000>
<MuxDevice: ID 376 ProdID 0x12a8 Serial 'f687347fb37bf8121a4e04b7ecb8dba5894e68a6' Location 0x14230000>
<MuxDevice: ID 375 ProdID 0x12a8 Serial '74e91e5d81d623b5cdbac86a75713553d3c0a86b' Location 0x14620000>
<MuxDevice: ID 374 ProdID 0x12a8 Serial '3651d993a87da228a7453e465186a9d5f93fc38d' Location 0x14220000>
Connecting to device <MuxDevice: ID 374 ProdID 0x12a8 Serial '3651d993a87da228a7453e465186a9d5f93fc38d' Location 0x14220000>
Connection established, relaying data
When I first read the code it looked like this was just trying 3 times for reliability, but it appears each call always finds a new device as each call processes a single packet which corresponds to one device (https://github.com/nabla-c0d3/multcprelay/blob/master/usbmux.py#L190)
Is it possible to increase this value? Perhaps with a flag? Or perhaps just process until the timeout occurs three times.
Let me know what you think,
Vinay
Thanks for making it work with multiple devices. Would be great if you can provide some changes
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.