Is HTML5 + JS enough for local communication?

I was brainstorming the webapp idea, something like Turntable.fm, but for LAN, so all computers on ONE network don't all download the song at the same time (killing the bandwidth), but rather the music around. The main functionality would be for a β€œmain” PC (one with speakers) to play a local song or receive songs on a local network and then to play.

My question is, is there a way for the HTML5 page (hosted on the Internet) to use JS to discover LAN users and communicate with each other directly, without the need for any central server? Example for clarification:

Office LAN has 2 users, Bob and Bill Bob enters lanmusic.com Bill enters lanmusic.com Internet dies, LAN is fine. Bob can still detect via the page that local user Bill is on the page too Bill sends a song to Bob through the page directly Bob plays song with page javascript music player 

So, the key points:

  • Javascript / HTML5 only
  • It is independent of the Internet, except for the initial loading of the web application.
  • Can detect LAN users, make LAN connections
+6
source share
2 answers

Read this blog post and another W3C article titled Real-time Web Communications

This functionality is still in the process of the W3C, and there will be no release of Candidate for this feature in the fourth quarter of 2012. Therefore, it will not be available soon.

Currently, as an alternative, my suggestion

+2
source

First of all, an error message is displayed about each browser if the Internet connection is lost. HTML5 can take care of this problem.

But then you can only use the js client site, which will not allow you to do what you want to do. Why aren’t you doing a regular desktop application? I have some friends make a CLI-based application for playing music on a central server, this server has speakers and will play music. Our github: https://github.com/Infogroep/mpgc

There are many other apps that do the same: check out XBMC

FYI: what you could do is create a dedicated network that does not rely on a central server. But this is still something being researched (i.e. http://soft.vub.ac.be/amop/ )

w3c contains an interesting article on implementing a home network for HTML5 http://www.w3.org/2011/09/webtv/papers/W3C_HNTF_Position_Paper_Sept_2011.pdf

and check the html5 websocket api http://dev.w3.org/html5/websockets/

+1
source

Source: https://habr.com/ru/post/904212/


All Articles