htmlcometwebsocketserver-push

HTML 5 Websockets will replace Comet?


It looks like Websockets in HTML 5 will become a new standard for server push.

Does that mean the server push hack called Comet will be obsolete?

Is there a reason why I should learn how to implement comet when Websockets soon (1-2 years) will be available in all major browsers?

Then I could just use Beaconpush or Pusher instead till then right?


Solution

  • Does that mean the server push hack called Comet will be obsolete?

    WebSockets are capable of replacing Comet, AJAX, Long Polling, and all the hacks to workaround the problem when web browsers could not open a simple socket for bi-directional communications with the server.

    Is there a reason why I should learn how to implement comet when WebSockets soon will be available in all major browsers?

    It depends what "soon" means to you. No version of Internet Explorer (pre IE 9) supports the WebSockets API yet, for example.


    UPDATE:

    This was not intended to be an exhaustive answer. Check out the other answers, and @jvenema's in particular, for further insight into this topic.