views:

42

answers:

3

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 receiving . Is this possible and if so how do I forward the local ports?

A: 

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.

jackrabbit
A: 

I would imagine it's easier to use emulator port redirections, either via the AVD console or the adb command.

Christopher
+2  A: 

The socat tool is useful for this:

socat TCP-LISTEN:Y TCP:localhost:X

(assuming you're in Linux)

Josh Tauberer