WEBSOCKET TRONG NODEJS.
WebSocket is a protocol providing full-duplex
communication channels over a single TCP connection. The WebSocket protocol was
standardized by the IETF as RFC 6455 in 2011, and the WebSocket API in Web IDL
is being standardized by the W3C.
WebSocket is designed to be implemented in web
browsers and web servers, but it can be used by any client or server
application. The WebSocket Protocol is an independent TCP-based protocol. Its
only relationship to HTTP is that its handshake is interpreted by HTTP servers
as an Upgrade request.[1] The WebSocket protocol makes more interaction between
a browser and a website possible, facilitating live content and the creation of
real-time games. This is made possible by providing a standardized way for the
server to send content to the browser without being solicited by the client,
and allowing for messages to be passed back and forth while keeping the
connection open. In this way a two-way (bi-directional) ongoing conversation
can take place between a browser and the server. The communications are done
over TCP port number 80, which is of benefit for those environments which block
non-web Internet connections using a firewall. Similar two-way browser-server
communications have been achieved in non-standardized ways using stopgap
technologies such as Comet.
The WebSocket protocol is currently supported
in most major browsers including Google Chrome, Internet Explorer, Firefox,
Safari and Opera. WebSocket also requires web applications on the server to
support it.

Websocket
được phân chia thành 3 mục sau:
1. Protocal implementations : Nó tập
trung vào high-performance và phục tùng các tiêu chuẩn của giao thức websocket:
ws, faye-websocket, websocket
2. Wesocket emulators: xây dựng trên sự
thực thi giao thức bởi việc them các fallback vào tính năng websocket-like sử dụng
việc truyền tải XHR long-polling hoặc htmlfile.Sự tồn tại những mô đun này phù
hợp cho tính năng real time của trình duyệt hoặc các mạng hỗ trợ websocket: sockjs,
engine.io,
3. Có những mô đun cấp cao được xây dựng
trên lớp emulator với sự tương thích như: broadcast message, channels, rooms và
custom event emitters: socket.io , websocket-multiplex, shoe, primus.
Nhận xét
Đăng nhận xét