Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error during WebSocket handshake: 'Connection' header is missing when using pussion passenger #2212

Closed
syed-shibli opened this issue Jun 29, 2019 · 3 comments

Comments

@syed-shibli
Copy link

syed-shibli commented Jun 29, 2019

Are you sure this is a bug in Passenger?
looks Like

Question 1: What is the problem?
WebSocket handshake is failing when using the Pushion passenger for Rails action cable setup. Whereas it is working with puma etc.

Error during WebSocket handshake: 'Connection' header is missing

To upgrade connection from HTTP to WebSocket client sent below two headers along with other application specific headers and if the server replies back with the same header then handshake is successful.

Upgrade:websocket
Connection:Upgrade

  • What is the expected behavior?

The response that I am expecting from the server for a handshake is

Sec-WebSocket-Accept:+/zbSswOvE7fwpUWN19gZDUMBfA=
Sec-WebSocket-Protocol:actioncable-v1-json
Server:Apache/2.4.29 (Ubuntu)
Status:101 Switching Protocols
Transfer-Encoding:chunked
Upgrade:websocket
Connection:Upgrade
  • What is the actual behavior?

Actual Response is and Connection header is missing here

Sec-WebSocket-Accept:+/zbSswOvE7fwpUWN19gZDUMBfA=
Sec-WebSocket-Protocol:actioncable-v1-json
Server:Apache/2.4.29 (Ubuntu)
Status:101 Switching Protocols
`Transfer-Encoding:chunked`
Upgrade:websocket

How can we reproduce it?

Setup the most basic example of Rails Action Cable and serve it using Apache + pushing Passenger

I checked the server log which saying handshake successful at the backend.

Started GET "/cable/" [WebSocket] for -------IP----- at 2019-06-28 13:20:59 +0000
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: upgrade, HTTP_UPGRADE: websocket)

Question 2: Passenger version and integration mode:
Phusion Passenger 6.0.2
Web Server: Apache/2.4.29 (Ubuntu)
Rails version:5.2
Ruby version:2.6.0

Question 3: OS or Linux distro, platform (including version):
Ubuntu 16/18

Question 4: Passenger installation method:
Phusion APT repo

Question 5: Your app's programming language (including any version managers) and framework (including versions):

Ruby version:2.6.0, Rails version:5.2

@CamJN
Copy link
Member

CamJN commented Jul 1, 2019

Is this different from #1202 ?

@syed-shibli
Copy link
Author

I tried the Pussion Passenger with Nginx which is working as expected. looks like the issue is with apache + Pushion passenger.

@CamJN
Copy link
Member

CamJN commented Jul 1, 2019

Yup, apache doesn't really support websockets right now, so this is a dup of #1202

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants