WebSocket Connection Failed

Source: Internet
Author: User
Tags haproxy
WebSocket Connection Failed

@ (markdown)
Recent project debugging WebSocket related NODEJS Implementation of the server, just contact web development of small partners to WebSocket protocol unfamiliar, encounter problems easily tragic. This is just about the part you understand and the experience of solving it.
First, nodeserver with the socketio, so wrote a page, with JS initiated websocket handshake, found has been longpoll, guess webserver not support WebSocket protocol, a check sure enough, Haproxy sets the HTTP reverse proxy. Abandon Haproxy, shake hands successfully, the browser requests the agreement upgrade to Websocket,web server consent, subsequent data through frame transmission. Solve, prove nodeserver no problem.
The second time, the client for the COCOSDX implementation of the WebSocket protocol, the connection nodeserver, the direct handshake failure, can not use the chrome development tools, so with tcpdump grab bag, Found Nodeserver caught in the HTTP protocol does not appear upgrade words, guess the front there is not support WebSocket protocol webserver intercept to, a question sure enough, before there is loadbalance, estimated that the general operation will not consider the WebSocket protocol , directly to the TCP proxy, change the fix.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

WebSocket Connection Failed

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.