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

Websocket error, success PUT, no refresh #62

Open
kyvaith opened this issue Oct 25, 2024 · 1 comment
Open

Websocket error, success PUT, no refresh #62

kyvaith opened this issue Oct 25, 2024 · 1 comment

Comments

@kyvaith
Copy link

kyvaith commented Oct 25, 2024

Hi, I'm trying to enable your plugin but I have a trouble with websockets.
I've followed instructions in readme. Installed redis-server, created cable config file, same as in Readme, restarted redis login/logout and checked my webserver confg. I'm using Bitnami stack Redmine so I have an Apache Web Server instead of Nginx. Without redis server started I get in browser:
image

Starting server with bundle exec rails server -e production -b 0.0.0.0 gives me:

=> Booting Puma
=> Rails 6.1.7.8 application starting in production
=> Run bin/rails server --help for more startup options
Puma starting in single mode...
* Puma version: 6.4.2 (ruby 3.2.1-p31) ("The Eagle of Durango")
*  Min threads: 0
*  Max threads: 5
*  Environment: production
*          PID: 32067
* Listening on http://0.0.0.0:3000

And after login/logout with redis server up:

image

My Apache config is:

PassengerPreStart https://localhost:443/
<VirtualHost *:443 _default_:443>
  ServerName app
  SSLEngine on
  SSLCertificateFile "/opt/bitnami/apache/conf/app.crt"
  SSLCertificateKeyFile "/opt/bitnami/apache/conf/app.key"
  DocumentRoot /opt/bitnami/redmine/public
  # BEGIN: Configuration for letsencrypt
  Include "/opt/bitnami/apps/letsencrypt/conf/httpd-prefix.conf"
  # END: Configuration for letsencrypt
  # BEGIN: Support domain renewal when using mod_proxy without Location
  <IfModule mod_proxy.c>
    ProxyPass /.well-known !
  </IfModule>
  # END: Support domain renewal when using mod_proxy without Location
  <Directory "/opt/bitnami/redmine/public">
    Options -Indexes +FollowSymLinks -MultiViews
    AllowOverride All
    Require all granted
    PassengerEnabled on
  </Directory>
  RailsEnv production
  # BEGIN: Support domain renewal when using mod_proxy within Location
  <Location /.well-known>
    <IfModule mod_proxy.c>
      ProxyPass !
    </IfModule>
  </Location>
  # END: Support domain renewal when using mod_proxy within Location
</VirtualHost>

In logs I get:

Started GET "/cable" for 127.0.0.1 at 2024-10-24 21:00:30 +0000
Started GET "/cable/" [WebSocket] for 127.0.0.1 at 2024-10-24 21:00:30 +0000
Successfully upgraded to WebSocket (REQUEST_METHOD: GET, HTTP_CONNECTION: upgrade, HTTP_UPGRADE: websocket)

So I assume there is no need to override headers.

What could be wrong?

@MayamaTakeshi
Copy link
Owner

Hi, I don't know much about apache.
But I suppose you should be using this module:
https://httpd.apache.org/docs/2.4/mod/mod_proxy_http.html
which deprecates this old one:
https://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html

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

2 participants