Ravi Vyas
Ravi Vyas

Reputation: 12375

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

Upvotes: 1

Views: 1083

Answers (3)

Josh Tauberer
Josh Tauberer

Reputation: 161

The socat tool is useful for this:

socat TCP-LISTEN:Y TCP:localhost:X

(assuming you're in Linux)

Upvotes: 6

Christopher Orr
Christopher Orr

Reputation: 111565

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

Upvotes: 0

jackrabbit
jackrabbit

Reputation: 5663

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.

Upvotes: 0

Related Questions