dragostis
dragostis

Reputation: 2662

How to forward a localhost port?

How can I simply forward a port from the Android emulator (127.0.0.1:5555) to my LAN (192.168.1.102:5555)?

I don't think I can change the IP address of the emulator so the only way I see I can do this is by forwarding that port to the network.

I just want to access my powerful PC emulator from my laptop through adb.

Upvotes: 2

Views: 2124

Answers (1)

Loic
Loic

Reputation: 1248

If you want to forward the port, you have to change its number. You should not be allowed to listen to 5555 from 2 applications (you application and the forwarder).

I don't know about android emulator, but you can probably configure it (and your firewall) to accept incoming connections from your LAN (and not only from localhost).

If you still want to perform a port redirect you can use netcat (installed on most baseline unix/linux systems, you can find ports for Windows from google)

e.g. redirect incoming connections on port 8080 to local service on port 5555
nc -L 127.0.0.1:5555 -p 8080 -vvv

Upvotes: 1

Related Questions