Skip to content

Wrong basepath used with socket.io in v1.43.0+ #13055

Closed
@bvenreply

Description

Bug Description:

The wrong basepath is used with socket.io when accessing the backend from a reverse proxy on a path other than the root.

Steps to Reproduce:

Can be reproduced by running the browser example and accessing through a local nginx.

  • Checkout master or v1.43.0

  • Build/run the browser example with yarn && yarn browser build && yarn browser start (Theia will run on port 3000)

  • Run nginx using the following nginx.conf

    http {
        server { 
            listen 3300;
    
            location ~* /proxy/(.*)? {
                proxy_set_header Host $host;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $remote_addr;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_ssl_verify off;
    
                if ($args) {
                    proxy_pass http://127.0.0.1:3000/$1?$args;
                }
    
                proxy_pass http://127.0.0.1:3000/$1;
            }
        }
    }
    events {}
  • Access Theia via http://localhost:3300/proxy/

  • Observe the blank page and the following message printed to the backend logs:

    root ERROR Cannot find a ws handler for the path: /proxy/services

    compare by accessing directly via http://localhost:3000/. Also compare to the previous version by checking out v1.42.1 and rebuilding, both paths will work fine.

Additional Information

  • Operating System: Debian 6.1.55-1 (2023-09-29) x86_64 GNU/Linux
  • Theia Version: 1.43.0
  • Browser: Chromium version 119.0.6045.105, Firefox version 115.4.0esr (64-bit)
  • Nginx: Docker image docker.io/library/nginx@sha256:86e53c4c16a6a276b204b0fd3a8143d86547c967dc8258b3d47c3a21bb68d3c6

Activity

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

Metadata

Assignees

No one assigned

    Labels

    bugbugs found in the applicationwebsocketissues related to websockets/messaging

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions