0

I would like to know if it is possible to establish a WebSocket connection between an HTML 5 app running on a browser and a websocket server running in a electronics custom board. The board uses an ATSAMS70 and WINC1500. Both will be always running in the same local area network and I would like to cover the majority of internet capable devices: MAC/Windows machines, iOS, Android. Some kind of method like Bonjour or service discovery would be great if HTML 5 had one...

the_moon
  • 553
  • 1
  • 7
  • 21
  • It is possible to establish a webSocket connection between any HTML5 app and any standard webSocket server as long as you know either the IP address or the DNS name of the webSocket server. – jfriend00 Aug 23 '16 at 15:41
  • So, I would need to somehow assign a DNS name to the service provided by my custom board. I would need a server running in the LAN for that, right? – the_moon Aug 23 '16 at 15:43
  • Local service discovery like Bonjour provides is not yet a standard part of browser implementations. There are some ways to do it using a browser plug-in such as [Bonjour Discovery in Javascript](http://stackoverflow.com/questions/1828217/bonjour-discovery-in-javascript-maybe), but that's not something you can depend on across the broad array of devices you list. If the web page comes from a local web server, then the local web server could do the discovery and the web page could use ajax to ask the local web server for discovery info. Otherwise, it's a local DNS or local server solution. – jfriend00 Aug 23 '16 at 17:38
  • When a web browser connects to any hostname, whether that is a web server or a web socket, the browser's standard DNS lookup logic is used to find the IP. In a LAN scenario, the router provides DNS for connected devices, so the browser should be able to find the IP of the board if it has a hostname. If the board does not have a hostname, check if your LAN router has an option to assign its own hostname for the board's IP/MAC. – Remy Lebeau Aug 24 '16 at 01:56

0 Answers0