VPS - Passenger - Node - WebSocket Reserved Bits Error

Hi guys.

I have a VPS which is running Passenger and a Node application (server). This is all working as expected.

The application is setup to handle WebSocket connections. The “ws” module is being used for this. Again, this all works as expected, at least when running locally.

When the application is accessed via my domain, the application starts and runs successfully, but the WebSocket connections fail with the error: One or more reserved bits are on: reserved1 = 0, reserved2 = 1, reserved3 = 1

I also occasionally receive Invalid Frame Header errors.

After a lot of debugging the problem appears to be with the Apache and/or Passenger setup on DreamHost. The application receives the standard HTTP Upgrade request, the “ws” module handles the upgrade, and a new connection is established. However, it looks like the Apache/Passenger is breaking the connection by sending its own response through the WebSocket connection.

The application is served over HTTPS, and the WebSocket connections use the WSS protocol.

Has anyone here encounted this problem before, and if so, were you able to find a solution?

Thank you.

This issue was resolved by switching from Apache to Nginx. Passenger continued to work as expected, and the WebSocket connections worked over HTTPS/WSS.

This topic was automatically closed 60 minutes after the last reply. New replies are no longer allowed.