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

odoo 16 longpolling is deprecated replaced by websocket #1971

Open
icf20 opened this issue Jul 13, 2024 · 4 comments
Open

odoo 16 longpolling is deprecated replaced by websocket #1971

icf20 opened this issue Jul 13, 2024 · 4 comments
Milestone

Comments

@icf20
Copy link

icf20 commented Jul 13, 2024

# Needed for real time message / chat feature (longpolling)
    ProxyPass /longpolling/poll http://127.0.0.1:8072/longpolling/poll/ timeout=200
    ProxyPass /longpolling/poll/ http://127.0.0.1:8072/longpolling/poll/ timeout=200
    ProxyPassReverse /longpolling/poll/ http://127.0.0.1:8072/longpolling/poll/

this needs to be removed from apache2 config no?

@JedMeister JedMeister added this to the 18.1 milestone Jul 16, 2024
@JedMeister
Copy link
Member

Thanks for the heads up on this.

Can you confirm that there is no additional config required to make Odoo work as expected after removing this config?

@icf20
Copy link
Author

icf20 commented Jul 16, 2024

u need something like this for the websocket no? i am not sure

  RewriteEngine On
  RewriteCond %{HTTP:Upgrade} =websocket [NC]
  RewriteRule /(.*)           ws://127.0.0.1:8069/$1 [P,L]
  RewriteCond %{HTTP:Upgrade} !=websocket [NC]
  RewriteRule /(.*)           http://127.0.0.1:8069/$1 [P,L]

see odoo/odoo#106339

@JedMeister
Copy link
Member

Thanks for the hint & the link, plus bring this to my attention in the first place.

I've got my head pretty deep in something else ATM, but I'll have a closer look ASAP.

@marcos-mendez
Copy link

marcos-mendez commented Aug 6, 2024

I think there is a misunderstanding here. The problem is not the websocket as this is native from any webserver (nginx or apache) the problem is the Directive that is being callend in the config file.

it used to be the longpolling directive now it is called gevent_port = 8072 this directive will be in transition until version 18 (as far as i know)

So what should be done actually (and as recomended a external reverse-proxy nginx by Odoo)

is to set a websocket location as in this example:

`
server {
listen 80;
listen 443;
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}

server {
server_name example.com;
# The internal IP of the VM that hosts your Apache config
set $upstream 192.168.1.160;

    #Odoo LongPolling COMMENT if not Odoo
    location /longpolling {
            proxy_pass http://$upstream:8072;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
    }

    location /websocket {
            proxy_pass http://$upstream:8072;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header X-Forwarded-Proto $scheme;
    }

    location / {
            proxy_pass_header Authorization;
            proxy_pass http://$upstream:8069;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_http_version 1.1;
            proxy_set_header Connection “”;
            proxy_buffering off;
            client_max_body_size 0;
            proxy_read_timeout 36000s;
            proxy_redirect off;
    }

}
`

I think this is not a issue from the odoo tkl app actually is an issue of the Reverse Proxy settings.

Any question i'm glad to help

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

No branches or pull requests

3 participants