-
Notifications
You must be signed in to change notification settings - Fork 547
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
WebSockets don't work on Apache #1202
Comments
The chunked encoding problem can be solved by setting Content-Length: 0 in the response, which will prevent Apache from setting Transfer-Encoding.
However, it looks like the problem is more complicated than just solving this. The current Apache module currently does not support simultaneously forwarding request data and response data, so WebSockets still doesn't work. Worse, instead of triggering an error, the connection just freezes. Fixing this is non-trivial. I'm postponing it to a later release. |
👍 Waiting for this eagerly. |
+1 |
any news on this? |
Unfortunately not. If you need WebSockets, for the time being we recommend using Nginx, or using Passenger Standalone behind Apache + mod_proxy. |
See phusion/passenger-ruby-websocket-demo#2, appears WebSockets are still not working under Apache mod_passenger in 5.0.18? (It's very possible that I am doing something wrong in my Apache .conf) Thanks for Passenger - it's incredible! |
@vanboom That is correct, WebSockets do not work yet in the Apache version. For the time being, we recommend that you use the Nginx version, or Apache + Standalone in a reverse proxy setup, if you need WebSockets. |
Is this a wontfix? |
@siegy22 not exactly, but it's blocked on the Apache project improving their module. |
@FooBarWidget |
@annymosse |
Does this apply to cpanel ? |
@beppe9000 Yes, since cPanel's default web server is Apache. |
is there an open issue on Apache's side we can track? |
Any updates on this? |
Sorry for the wrong info earlier. Seems like apache itself still supports prefork worker mpm, just my hosting management software doesn't. |
Is there some Apache issue that we can refer to that will unblock this? |
how about this: https://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html |
mod proxy wstunnel forces you to specify a separate target for your ws traffic. Essentially you need something listening on another port than the main http port, which will handle your ws traffic. I'm fairly certain that limitation is why people want a better solution. |
I don't believe that's true. You don't need a separate port, just a separate path. This snippet, for example, is working just fine for me in production: # Proxy WebSocket requests to /stream
ProxyPass /stream ws://127.0.0.1:56488/stream retry=0 timeout=5
# Proxy all other requests requests to /
ProxyPass / http://127.0.0.1:56488/ retry=0 timeout=5
ProxyPassReverse / http://127.0.0.1:56488/ |
what ? I can use Apache with Rails ActionCable now ? @strugee you are a life saver... I had long forgotten about this... |
Just to clarify: The actual WebSockets-endpoint is also delivered by Passenger, and not a separate process? In the past, I had to use a separate |
I can't comment on Passenger support as I haven't used it for years. I was talking strictly about generic Apache mod_proxy and mod_proxy_ws. |
Almost 10 years, has there been any progress or alternative solutions explored over, besides resorting to running a parallel server and rewriting routes in Apache? |
I'm sure very sad when I have to move away from the Apache module when an app starts using WebSocket. |
If the response has the chunked transfer encoding, then WebSockets handshakes become corrupted. See https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/phusion-passenger/XtjxA8E1idw/Z029OysamjsJ for the report.
The text was updated successfully, but these errors were encountered: