it's called comet, and last time i checked, was a bit complicated.
there is no single, standardized way to do this. it's the wild west.
Comet requires both front and back end code, and different techniques work better in different browsers.
i recommend a script tag trigger and an AJAX data pipe.
you can send stuff to and request stuff from the server whenever you want, so all you really need to do is know when to do so, which requires a 2nd connection.
when something happens on that 2nd connection, you re-use the first connection to actually fetch the data, and optionally upload more. the 2nd connection should be used only to trigger.
if you try to push data through your 2nd connection, you will find a lot of cross-browser headaches.
BROWSER STATS [% share]
(2013/10/31) IE7:0.5, IE8:8.6, IE9:5.3, IE10:12.3, FF:17.7, CH:41.8, SF:8.1, MOBILE:20.4