Websocket Error

S.T.W.8 years ago

Hello. I've got the websocket error but my connection works fine. The problem is the timeout of the connection. I use Nginx as a reverse proxy with the following configuration.

location /gps/ {  
         proxy_pass http://127.0.0.1:8082/;  
         proxy_http_version 1.1;  
         proxy_set_header Host $host;  
         proxy_set_header Upgrade $http_upgrade;  
         proxy_set_header Connection "upgrade";  
         proxy_cookie_path /api /gps/api;  
         proxy_read_timeout 7d;  
}

When no data from my GPS device is pushed to the webbrowser the connection is closing and I get the websocket error. My solution is to set proxy_read_timeout 7d. Maybe a websocket keep alive function were helpful.

renaud8 years ago

Here is my config (note that this is for SSL but it should work fine )

    location / {
            proxy_pass http://127.0.0.1:8082/;
            proxy_set_header Host $host;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_buffering     off;
            proxy_connect_timeout 43200000;
            proxy_send_timeout    43200000;
            proxy_read_timeout    43200000;
            proxy_redirect off;
            proxy_set_header Proxy "";
            proxy_cookie_path /api "/api; secure; HttpOnly";
    }
S.T.W.8 years ago

Thanks. I will try this out. But I still have one problem with refresh on my Android phone. When I start the Traccar Manager app and it was in RAM there is no refresh of the positions. I have to clear it out of the RAM to force a reload.

Anton Tananaev8 years ago

What version are you using? Have you tried waiting for a couple of minutes?

S.T.W.8 years ago

I'am using version 3.14 . On my desktop PC with Chrome the pushing of new data works as intended. On Android (7.1.2) also in Chrome it works when i manually reload the page until I lock the phone. When I reopen the page and it was in RAM there is no update of the data until I reload the page, even when I wait a few minutes. It seems that the websocket connection breaks when the phone is in standby.

Anton Tananaev8 years ago

I would recommend to check developer console for more information on what's happening with the app.