Port forwarding on linux local loop to connect two android emulators
I am trying to communicate between two android emulators for communication , thus I am trying to forward port X to port Y on 127.0.0.1 where port X is the port I am transmitting too and Y is the one I am rece开发者_开发技巧iving . Is this possible and if so how do I forward the local ports?
The socat tool is useful for this:
socat TCP-LISTEN:Y TCP:localhost:X
(assuming you're in Linux)
Googling revealed portfwd. Although it is quite ancient, it seems to do what you describe. Other results suggest that iptables may be able to do what you want as well, but there were no succinct guides that I could find.
I would imagine it's easier to use emulator port redirections, either via the AVD console or the adb
command.
精彩评论