oTree Forum >

Problem with websockets

#1 by camilo_suarez

Hi everyone,

I’m running a negotiation experiment in oTree where participants exchange offers in real time using live pages (liveSend, liveRecv, and live_method). With help from my university’s IT department, I deployed the app on a university server.

However, when I try to send an offer, I get the following error in the browser console:
WebSocket connection to 'wss://econlab.utdt.edu/live?...' failed: The operation couldn’t be completed. Socket is not connected.

I’m wondering if this is an issue with the server configuration or something I might be missing in my oTree setup.

Has anyone experienced something similar, or do you have suggestions for what I should check on the server side?

Thanks a lot for any guidance!
Best,
Camilo

#2 by xindamate_com (edited )

do you use nginx, if yes, you need to configure like this

....
    # WebSocket/long-poll endpoints
    location ~ ^/(create_demo_session|live|auto_advance)(/|$) {
        proxy_pass http://otree_upstream;
        proxy_http_version 1.1;

        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $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;

        proxy_read_timeout 600s;
        proxy_send_timeout 600s;
        proxy_buffering off;
    }


...

Write a reply

Set forum username