Can not create a socket on LocalHost


Hi all:

Before I start, I wanted to let you know that I am noob to this networking thing. I am trying to make a TCP socket to communicate with an android application. When I run my code with
in flytsim shell, It works fine as it creates socket which can bind with all available interfaces. (Ref.

But when I use it with
where IP_ADDR is my localhost IP, I get binding error saying it can’t assign requested address. upon checking it seems it gets the IP of the Docker and unable to reach the localhost. And as far as I can understand, docker IP is not visible outside to other devices on network.

I ran the same executable outside the flytos, in regular roscore, it binds to localhost. Can anyone tell me a way to create socket to localhost so I can connect to drone over it using android app.


Hi @iamchauhan55,

Are you trying to connect to the WebSocket layer of FlytSim?
Do you want your android application to connect to FlytSim via Websocket?

If that be the case, in Android app, you can use ‘okhttp3’ websocket library, and use this static function of the library,

Builder.with(“ws://” +ipAddress+ “:80/websocket”)