using web sockets if the browser supports it, otherwise falling back to polling