WebSockets - A Conceptual Deep-Dive


XMLHttpRequest 和 AJAX
long polling

WebSockets are a thin transport layer built on top of a device’s TCP/IP stack. The intent is to provide what is essentially an as-close-to-raw-as-possible TCP communication layer to web application developers while adding a few abstractions to eliminate certain friction that would otherwise exist concerting the way the web works. They also cater to the fact that the web has additional security considerations that must be taken into account to protect both consumers and service providers.



现在 websockets 已经是主流了吧


现在和多框架都支持 websockets