yume-chan / ya-webadb

ADB in your browser
https://tangoapp.dev/
MIT License
2.21k stars 296 forks source link

[Suggestion] Support forward command #649

Open fanksy opened 1 month ago

fanksy commented 1 month ago

Pre-issue checklist

How can Tango be improved?

Can you add forward api?

How should the API change?

adb.forward.addExternal("local address", "device address");

(Optional) Other information

No response

yume-chan commented 1 month ago

adb.forward.addExternal("local address", "device address");

Forward tunnel is implemented in ADB server, not ADB daemon.

See https://github.com/yume-chan/ya-webadb/discussions/641#discussioncomment-9630956, If you are using direct connection mode, you need to listen the local address yourself and forward the connection to daemon using adb.createSocket: https://docs.tangoapp.dev/api/socket/#forward-tunnel

If you are using server-client mode, it's not hard to add forward tunnel commands, but this is not a priority and I'm working on other things right now.

yume-chan commented 1 week ago

Please clarity what you want to do, otherwise this issue will be closed.