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