Can I use Javascript to communicate with a server without XMLHttpRequest?

I am trying to write a chat client using javascript, but only communication with the server using XMLHttpRequest prevents me, which, as far as I can tell, is completely unsuitable, as many have told me.

I searched for other network functions, but did not find and said that they were not there. It's almost enough to make me stop looking, except that Gmail does it somehow. It does not request any requests for several minutes, then as soon as I send an email to myself, my mailbox in another window sends a POST request and receives an email. Since he did not send HTTP requests to the server for several minutes (I checked with firebug), he could not talk to the server like that, since he knows when he has an email to receive?

+3
source share
6 answers

I asked a similar question a while ago, take a look at this, there are quite nice answers.

- ajax push (activemq cometd - )?

+2

Gmail Comet. , , - , <script> <iframe>. .

+1

GMAIL HTTP. , , , http-streaming. , .

, , BOSH ( prosody BOSH) . Strophe.js - javascript .

0

WebSockets.

:

  • , HTTP ( AJAX/Comet)
  • .
  • HTML5, " ".: -)

:

pusherapp, , . 5 10 000 .

google WebSockets: http://blog.chromium.org/2009/12/web-sockets-now-available-in-google.html

, wsproxy, WebSockets, - TCP, noVNC ( VNC HTML5). noVNC wsproxy C python. : noVNC.

0
source

Source: https://habr.com/ru/post/1770014/


All Articles