mercredi 22 avril 2020

Services discovery (Upnp, mDNS, etc.) from any browsers

I am looking for the best solution to perform the following task:

I am currently working on a device that is connected to my network. In most cases, I will have several identical devices connected, with a local IP for each one. My goal is to be able to open a browser from a computer located in the same network, and reach the Apache server located in the device. To do so, I need to know the IP of the device I want to connect to, or the name of the device published through mDNS protocol (each device is running Avahi). So I want to be able to type a web address in my browser, let say https://ift.tt/2XXZMz4, that will trigger a services discovery on the client computer, and display my devices IP.

So far, I have been looking at: - mDNS. Unfortunately, mDNS seems "disabled" by default on Android devices. I can connect to my device with hostname.local, but not from an Android phone. I want the solution to be supported on most of the browsers without any needs, no extra library, no installation, etc. - Upnp. Is there a way to perform a UPNP discovery from a browser, as we know it uses UDP sockets ? - TCP sockets. Try to connect every single IP of my local network, and send a "Are you a device ?" message. It doesn't look optimized at all, but it looks the only way to do it and to be compatible with any browsers. - Progressive Web App. It seems PWA offers a bit more interactions with the hardware. But I can't find anything about UDP networking.

Do you have any ideas about how to perform this ?

Regards,

Julien.




Aucun commentaire:

Enregistrer un commentaire