ADB Forward to devices in a farm #579
-
Greetings, I want to ask if it should be possible to forward and/or reverse ports to a device connected to a devicefarm., using "adb connect server:port" as shown at the device's detail page. Setup is my dev-linux, where at localhost:8080 a http server is sitting. I want that 8080 to be accessible at the device in that farm at 8081, so I do "adb reverse tcp:8081 tcp:8080". That call returns "8080" , and on the shell of the device inside the farm I can see a (v6) localhost 8081 with "netstat -atn". So far, so good. But when opening the chrome browser on that device and entering "localhost.8081", it says that localhost did not return anything. And the forward port does not disappear when the adb remote connection is closed. Also, netcat that port on localhost on the device's shell will return nothing (it should stick in a stdin). So the question is, should that be possible at all? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
@ConfusedMerlin , => https://github.com/devicefarmer/adbkit#devicereverseremote-local So as the reverse port forwarding is created on the remote ADB server, you can redirect that flow to your considered http server, for that you can use the |
Beta Was this translation helpful? Give feedback.
-
Another solution is simply to use the 'Advanced->Port forwarding' feature at UI level, it should fit your need, for instance : |
Beta Was this translation helpful? Give feedback.
@ConfusedMerlin , => https://github.com/devicefarmer/adbkit#devicereverseremote-local
So as the reverse port forwarding is created on the remote ADB server, you can redirect that flow to your considered http server, for that you can use the
socat
command for instance on the remote ADB server, something like the following should work:# socat TCP4-LISTEN:8080,reuseaddr,fork TCP4:YOUR_dev-linux_IP:8080