0

HTML5 supports online web storage which can help in making our website to work offline. But, how can one share data between systems that are connected through LAN when offline?

The requirement is:

If offline, there will be a centralised system, through which all the systems of a particular group will be connected. Any update on one system will be reflected in all the systems in that group. When the centralised system go online, the data will be synced with a remote mysql DB.

And if online, all system will update to the remote mysql DB directly and hence always in sync.

How to get started for such a system?

Vivek Vardhan
  • 1,118
  • 3
  • 21
  • 44
  • 2
    As the answer from duskwuff states, to this day, that's not possible. But that's acutally a cool idea! I think that's possible in some compiled programming languages, but you'll probably have to face lots of security issues. – Gui Imamura Nov 26 '15 at 19:20

1 Answers1

2

You can't. This isn't a thing that HTML5 applications can do.

Specifically, there is no way for such an application to "discover" other instances of that application on the network, or to communicate with them, while offline.

Communicating with the "centralized system" you're describing in your question would require your application to be online. And if you're able to do that, the application doesn't need to operate in that fashion anyways!

  • In my case, the `centralised system` is also offline and connected to only a set of offline systems within same LAN network. Can systems communicate within a particular network to the `centralised system`?? – Vivek Vardhan Nov 26 '15 at 20:29
  • 1
    If there is a centralized system in a fixed location you can communicate with, *you're not offline*. You're just not on the Internet. Run your application online from that system. –  Nov 26 '15 at 21:10