The task is to build an app that can send and receive messages over a local network. We can do it using sockets, but today we are going to create a simple app that uses an HTTP server for communication. The idea is very simple: The app has a simple HTTP server to send a message: Get my local IP address Try to send message to every local IP like: GET xxx.xxx.xxx /?msg=message GET xxx.xxx.xxx /?msg= message ... GET xxx.xxx.xxx /?msg= message .1 .2 .254 Local IP address We need to get the local IP address to send messages and to create an instance. I created a simple method for this: HttpServer It returns an IP address something like this: 192.168.0.107 We will use the leading three octets to send a request to every local IP: 192.168.0.xxx HttpServer To able to receive requests we need to create an instance of using our local IP and any port from 1024 to 65353. HttpServer We return ‘Ok’ when we receive a request. To check if it works you can go to the link and you should see the ‘Ok’ message. http://{your local IP}:8080 Before checking on iOS or Android you need to add permissions. Add to iOS file: info.plist NSAppTransportSecurity NSAllowsArbitraryLoads < > key </ > key < > dict < > key </ > key < /> true </ > dict Add to file: AndroidManifest.xml <uses-permission android: = /> name "android.permission.INTERNET" Handling requests To make it simple we will use the GET method and use query parameters to send a message like this: http: //{local IP}:8080?msg=message&ip=ip If the request has the parameters like and we add those values to our message list and call the or notify to show that list on the screen: msg ip setState To get the full source, check the Github project below. Sending messages We have to send the message to every local IP. We can use our local IP address to get the leading three octets and, from that, build the list of local IP addresses: In this example, it sends messages only to IP addresses from to but theoretically, we can send it from 1 to 255. x.x.x.1 x.x.x.199 Result We can now send messages to active local devices. In the image below the left one is a physical iOS device and the right one is a macOS desktop App. As you can see they can send messages to each other and they have different local IP addresses. You can find the working example here: https://github.com/usenbekov/local-network-comm