Html5-I wrote a WebSocket server using php, and an error occurred in IE.

Source: Internet
Author: User
Firefox runs normally, but IE and chrome have problems. After the handshake is successful under IE, the send () information is sent to the server, and the server uses socket_write to return the original information to IE. Instead of triggering the onmessage event, the onclose event is triggered. These days have been worrying about this problem...

Firefox runs normally, but IE and chrome have problems.
After the handshake is successful under IE, the send () information is sent to the server, and the server uses socket_write to return the original information to IE. Instead of triggering the onmessage event, the onclose event is triggered. These days have been worrying about this problem.
Can anyone help me answer this question?
Chrome
The red text below is: WebSocket connection to 'ws: // 127.0.0.1: 1199 'failed: A server must not mask any frame taht ie send to the client.

Baidu finds someone with the same problem as me:
Does the send function refer to socket_send or socket_write? Where is the $ mask parameter?

Reply content:

Firefox runs normally, but IE and chrome have problems.
After the handshake is successful under IE, the send () information is sent to the server, and the server uses socket_write to return the original information to IE. Instead of triggering the onmessage event, the onclose event is triggered. These days have been worrying about this problem.
Can anyone help me answer this question?
Chrome
The red text below is: WebSocket connection to 'ws: // 127.0.0.1: 1199 'failed: A server must not mask any frame taht ie send to the client.

Baidu finds someone with the same problem as me:
Does the send function refer to socket_send or socket_write? Where is the $ mask parameter?

After the IE handshake is successful, send () information to the server. Can the server print this information?

We recommend that you try it on chrome first. It may be a little strange on IE, And the socket may be downgraded to another method.

Http://stackoverflow.com/questions/16932...

Return other strings. Try again.

In current version (13), websocket performs mask processing on the client's send () information. It is said that it is converted to binary and then transmitted to the server. Therefore, if the server directly echo the information sent from the client, garbled characters are displayed. If you want to properly display the information that needs to be converted, the information sent from the server to the client will also be processed. I am not very clear about the specific principle. This is the answer I have summarized in a few days, the specific process depends on the example provided on the Internet.
Ps: Sure enough, English is very important for programmers.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.