I am currently doing some research for a project. The setup is simple, I have a computer running a service in my home network and any device connected to that same network should be able to discover the service automatically and use it. I have no specific technology requirement whether it is on the server or client side. The client knows about the service definition.
Other than that I have no idea what strategy to use, what technology to look at or whether I should go for a SOAP or a HTTP based service. I think going HTTP with REST API is the best for targeting all devices but I am opened to any suggestions.
Thanks.
One of the simplest ways to achieve this is to use UDP broadcast. Essentially:
- The server listens for UDP packets on a certain port.
- When a client wants to connect to the server, it sends a broadcast UDP packet to the certain port.
- When the server sees a broadcast packet, it replies to that client with information about what the actual address/URL of the server is.
There are established standards that build upon this idea, for example mDNS.
2