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

Subpath support in Code serve-web for WSS connections #208278

Closed
zuoky opened this issue Mar 21, 2024 · 8 comments
Closed

Subpath support in Code serve-web for WSS connections #208278

zuoky opened this issue Mar 21, 2024 · 8 comments
Assignees

Comments

@zuoky
Copy link

zuoky commented Mar 21, 2024

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: latest MR
  • OS Version: Kubernetes 1.28, ContainerD 1.7.0

Steps to Reproduce:

code serve-web --host 0.0.0.0 --port 8080 --default-workspace=/home/workspace --default-folder=/home/workspace --disable-telemetry --server-base-path=/ides/foo --without-connection-token

Related issue: Github Issue
Metion: @connor4312

@VSCodeTriageBot
Copy link
Collaborator

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.87.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

@zuoky
Copy link
Author

zuoky commented Mar 21, 2024

Thanks for creating this issue! It looks like you may be using an old version of VS Code, the latest stable release is 1.87.2. Please try upgrading to the latest version and checking whether this issue remains.

Happy Coding!

These are latest code as of 20240321, no version tagged yet.

@aeschli
Copy link
Contributor

aeschli commented Mar 21, 2024

Fixed by #207932

@aeschli aeschli closed this as completed Mar 21, 2024
@okalldal
Copy link

okalldal commented Mar 27, 2024

@aeschli this issue seems like it is still present. It is possible to start the server and get server-base-path to work for most network communications, but when accessing the server from the browser you get a popup indicating websocket connections fail. When inspecting network traffic, websocket connections indeed tries to initialize connections without the specified base path.

It looks like @zuoky also can confirm this issue since he asserts that he is using the latest code as of 20240321 (three days after #207932 was merged). @zuoky are you able to confirm that this is still not working from your side?

@aeschli
Copy link
Contributor

aeschli commented Mar 27, 2024

Here's what I tested and works for me: (latest insiders build)

If you have any other configuration (e.g. a proxy server) you will have to investigate if the issue is there. If there's anything VS Code needs to add to make additional setups working, please let us know. The best is to provide a fix through a PR.

If the steps above don't work for you, please create a new issue and describe what's not working.

@zuoky
Copy link
Author

zuoky commented Mar 27, 2024

We have tried these and can reproduce this issue:

1 Configure a server base path and start vscode.
2 Through nginx proxy, for example, when requesting https://foo.example.com/ide/foo, a wss error occurs. By checking the browser console, you can see the wss error, and the request address is wss://foo.example.com/oss-xxxx, which does not include the server base path URI path.
3 An example configuration for nginx proxy is as follows:

upstrem vscode {
  server  [192.168.0.100:8888](http://192.168.0.100:8888/);
}
server {
   servername [foo.example.com](http://foo.example.com/);
   location / {
            proxy_pass http://vscode/;
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
      }
}

@okalldal
Copy link

okalldal commented Mar 27, 2024

@aeschli Could the reason why it works for you be that since you are not behind a proxy, the WSS request will succeed even without the serverBasePath added (i.e. neither the server nor client expects the WSS requests to have the base path added).

In my and @zuoky :s case only requests with the proper prefix will be forwarded to the server and thus the WSS connections will be refused.

@aeschli
Copy link
Contributor

aeschli commented Mar 28, 2024

Again, please file a separate issue so we can investigate in there.

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

4 participants