[note] solve the problem of error during websocket Handshake: Net:: err when using workerman and Apache to create WSS service_ RESPONSE_ HEADER…

The error during websocket Handshake: Net:: err often appears in WSS services generated by Apache proxy_ RESPONSE_ HEADERS_ Truncated , but you can connect successfully by refreshing the page several times

No way was found in the official documents, and finally in the https://github.com/ratchetphp/Ratchet/issues/645 A solution has been found

This is not a worker’s warehouse, but the solution is universal

I could say that when some client disconnects without default websockt close protocol, ratchet keeps the connection “open”, but when a new user connects then ratchet reuses somehow the last “open”(closed) connection… Because the new client uses a old “active” connection, when it sends the HTTP handshake, ratchet complains because it isn’t the default message frame.

It’s the reuse of connections that causes this problem

Modify the configuration file of Apache conf.d/ssl.conf

Add a configuration disableeuse = on in the reverse proxy, and the problem is solved

ProxyPass /wss ws:// disablereuse=On
ProxyPassReverse /wss ws://

Reference Links



Similar Posts: