I would say that you are looking for a comet / AJAX | Server push / etc. See my previous answer on this for some pointers. Basically, you simulate inverting the connection between the server and the client - this is the server that initiates the connection here, because it wants, for example, to inform the user that his / her friend just went to the Internet, etc.
Implementations of this technique change quite quickly, so I won’t make any final recommendations - choose the one that best suits your needs :)
source
share