How does in-browser chat work?

前端 未结 6 706
攒了一身酷
攒了一身酷 2020-12-24 06:53

Just curious. How exactly does chatting in a browser work? Usually if a user goes to a web page, his/her webbrowser requests the page content. A server produces output and s

相关标签:
6条回答
  • 2020-12-24 07:16

    Orbited is a good way to implement this, it uses comet methodologies. You can find a tutorial here.

    Someone mentioned ajax polling, but comet is always better than polling. Well, that's just a sensationalist title, but comet is definitely more appropriate and can lead to less stress on the server side, with the right back-end.

    0 讨论(0)
  • 2020-12-24 07:24

    There are some push technologies, such as Comet, but they're not widely implemented. Most of the time this is accomplished via polling at some small interval with AJAX and downloading any new messages that are available since the last downloaded message.

    0 讨论(0)
  • 2020-12-24 07:26

    It uses AJAX - a client-side javascript running on the GMail user's browser sends and receives the messages from the Google server, and writes them to the browser window - no reload of the page required.

    0 讨论(0)
  • 2020-12-24 07:30

    Modern chat applications use SSE's (Server Sent Events: a feature of html5) to send new messages to browsers

    0 讨论(0)
  • 2020-12-24 07:36

    I've develop a browser chat similar to facebook chat technology ( http://chatsign.com ). It is not a push technology but something better than polling, its call ajax long polling.

    For more information about ajax long polling you can do some research or visit : http://techoctave.com/c7/posts/60-simple-long-polling-example-with-javascript-and-jquery

    0 讨论(0)
  • 2020-12-24 07:39

    Take a look at Comet

    0 讨论(0)
提交回复
热议问题