I can Propose other solution which can be implemented easier and won't need any 3rd party libraries.
The idea is to use Server-Side events. According to Mozila's documentation all modern browsers support the feature.
I won't copy/paste the code from their documentation. Instead, here is the link to their full example: https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events.
The fun part is that backend code in example is written in PHP.