of the server-side message (compare around, read the entire example, probably will understand)
registry.setApplicationDestinationPrefixes("/app")Refers to the prefix of the server's receiving address, meaning the prefix of the address that the client sends the message to the service side
The information defined in the above two methods is actually the opposite, one defines the address prefix that the client receives, and a pre
-defined string is used to distinguish between the protocols that are required for different services under the same URL. Easy to understand: Tonight I have to service A, do not mistakeFinally, to Sec-WebSocket-Version tell the server to use the Websocket Draft (Protocol version), at the initial time, the WebSocket pro
(a) WebSocket profileShort Connection : in the traditional HTTP protocol, the client and server side of the communication mode is a short connection, that is, the server side does not maintain a connection with the client, after the message is sent, will disconnect the connection, the next time the client communication, must be established and the server New connection, This is the short connection. In the case of a short link, the client must activel
Directory
What is WebsocketWhy use WebsocketPerformance theory AnalysisWebsocket service end and reverse generation practiceTest for reverse generation performanceWebsocket and HTTPWhat is Websocket
The Websocket is a Full-duplex communication protocol, initially defined by HTML5, that is built on a single TCP connection, which is independent of the HTML5 speci
-defined string is used to distinguish between the protocols that are required for different services under the same url. Easy to understand: tonight I have to service a, do not mistakefinally, to Sec-WebSocket-Version tell the server to use the Websocket Draft (protocol version), at the initial time, the WebSocket pro
distinguish between the protocols required for different services under the same URL. Easy to understand: Tonight I have to service A, do not make a mistake ~ Finally, Sec-websocket-version is to tell the server to use the WebSocket Draft (protocol version), at the initial time, the WebSocket protocol is still in the
This section describes declarative WebSocket programming, which can be compared with the latter programming WebSocket:First on the service side:@ServerEndpoint ("/chat") publicclassdeclarativeserver{ @OnOpen publicvoidonopen (sessionsession) { system.out.println ("somebodyiscoming!"); } @OnClose publicvoidonclose () {} @OnMessage publicvoid OnMessage (stringmessage,sessionsession) throwsIOException{ NBSP
WebSocket. Here, the only thing the server has to do is prepare a websocket-location domain for the client, no encryption, and poor reliability.
Client Request:
Get/ls http/1.1
upgrade:websocket
connection:upgrade
Host:www.qixing318.com
origin:http:// Www.qixing318.com
The server returns:
http/1.1 101 Web Socket Protocol handshake
upgrade:websocket connection:upgrade
://example.comFamiliar with the HTTP children's shoes may have found, this is similar to the HTTP protocol handshake request, a few more things. I'll explain the effect by the way.Upgrade:websocketConnection:UpgradeThis is the core of WebSocket, tell Apache , and Nginx so on server: notice, I initiated is the WebSocket agreement, quickly help me find the corresponding assistant processing ~ Not that old-fas
services under the same URL. Easy to understand: tonight I have to service A, do not mistakeFinally, Sec-websocket-version is to tell the server to use the WebSocket Draft (protocol version), at the outset, WebSocket protocol is still in the Draft stage, a variety of bizarre protocols have, And there are a lot of weir
the FF, Chrome and other browsers, there is no native support WebSocket. Here, the only thing the server has to do is prepare a websocket-location domain for the client, no encryption, and poor reliability. handshake protocol based on MD5 encryption method
Client Request:
Get/demo http/1.1Host:example.comConnection:upgradeSec-websocket-key2:Upgrade:websocketSec-
address this compatibility limit, such as: Open source Socket.io, see the Socket.io Introduction: Support WebSocket, web-side instant Messaging framework.6. SSE: Solutions for the Future 2SSE (server-sent event, server-side push events) is a HTML5 technology that allows the server to push new data to the client. This is a better solution than the client polling every few seconds to pull new data from the server.It can also push data from the server t
-defined string is used to distinguish between the protocols that are required for different services under the same URL. Easy to understand: Tonight I have to service A, do not mistakeFinally, to Sec-WebSocket-Version tell the server to use the Websocket Draft (Protocol version), at the initial time, the WebSocket pro
/1.1Host:server.example.comupgrade:websocketconnection:upgradesec-websocket-key: x3jjhmbdl1ezlkh9gbhxdw==sec-websocket-protocol:chat, superchatsec-websocket-version:13origin:http:/ /example.com Familiar with the HTTP children's shoes may have found, this is similar to the HTTP protocol handshake request, a few more things. I'll explain the effect by the way.
-defined string is used to distinguish between the protocols that are required for different services under the same URL. Easy to understand: Tonight I have to service A, do not mistakeFinally, to Sec-WebSocket-Version tell the server to use the Websocket Draft (Protocol version), at the initial time, the WebSocket pro
-defined string is used to distinguish between the protocols that are required for different services under the same URL. Easy to understand: Tonight I have to service A, do not mistakeFinally, to Sec-WebSocket-Version tell the server to use the Websocket Draft (Protocol version), at the initial time, the WebSocket pro
WebSocket assistant. Then, Sec_websocket-protocol is a user-defined string used to distinguish between the protocols required for different services under the same URL. Easy to understand: tonight I have to service A, do not mistakeFinally, Sec-websocket-version is to tell the server to use the WebSocket Draft (protoc
1. What is a socket? What is WebSocket?What's the difference between the two people who have heard about WebSocket technology for the 1th time? WebSocket is the implementation of just porting the socket concept to the browser?We know that two applications (processes) in the network need to communicate with each other at full duplex (that is, both sides can send m
with the HTTP children's shoes may have found, this is similar to the HTTP protocol handshake request, a few more things. I'll explain the effect by the way.Upgrade:websocketConnection:UpgradeThis is the core of WebSocket, tell Apache , and Nginx so on server: notice, I initiated is the WebSocket agreement, quickly help me find the corresponding assistant processing ~ Not that old-fashioned HTTP.Sec-
Base64 encode value, this is the browser randomly generated, tell the server: peat, do not confuse the nest, I want to verify that Nikki is not really a WebSocket assistant. Then, Sec_websocket-protocol is a user-defined string used to distinguish between the protocols required for different services under the same URL. Easy to understand: tonight I have to service A, do not mistakeFinally, Sec-
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.