How do they make real-time notifications?

Thus, the site, for example, overflows the stack of the page update part when things like increasing your reputation happen. How do they do it? Does the script check from time to time or is it somehow a push notification?

+3
source share
2 answers

About 2 years ago, stackexchange started using web sockets, as indicated here: https://meta.stackexchange.com/questions/125677/new-feature-real-time-updates-to-questions-answers-and-inbox

If you look at the source of the stackoverflow site, you will see that the JavaScript function subscribes to the web socket server.

. , Microsoft SignalR (http://signalr.net/), , , ( X , ).

Python, , - : https://pypi.python.org/pypi/websockets/1.0

!

+2

-, :

  • , .
  • URL .
  • GET URL-, , .
  • HTTP- , .
  • , ; GET URL- . , , .

, , -, HTTP- - HTTP. , HTTP- , .

+2

All Articles