Open mering opened 7 months ago
Can you be more specific what has to change? Feel free to provide a PR.
@aeschli basically serving the pages from/
instead of base path while keeping all links prefixed by base path.
@aeschli it could be that something like #210455 is enough.
Unfortunately, I couldn't test this.
I tried getting a testing environment on main
branch:
./scripts/code-cli.sh serve-web
error error getting latest version: Updates are are not available: no configured quality
.For testing one should be able to use a nginx reverse proxy with the following config:
server {
listen 80;
listen [::]:80;
location /some/path/ {
proxy_pass http://localhost:8080/;
proxy_set_header Host $http_host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection upgrade;
proxy_set_header Accept-Encoding gzip;
}
}
where 8080
is the port of code cli.
+1 for this, thanks ya'll. would be incredible to serve it behind jupyter proxy (that's also behind cloudflare proxy). The full availability of extensions is 🔑 for our users
+1 from my side, too. We would love to add VSCode as a webapp to our portal.
But it would need to run behind a proxy accessible at a special dynamically generated url which is user and login specific.
+1 from me. I'm trying to run VSCode serve web in a container within a VPC so that I have network access to other resources. Due to limitations, I can only run on some-url/subfolder
with a reverse proxy to my container.
Nginx config of @mering got me some of the way there. I added a sub_filter to rewrite static assets to /subfolder (hacky, I know), which fixed the 404s. Now I'm getting websocket connections error. Unfortunately, I don't think it's possible to rewrite web socket connection paths via nginx as well. That would require modifying the code directly.
@aeschli it could be that something like #210455 is enough.
Unfortunately, I couldn't test this. I tried getting a testing environment on
main
branch:
- Running
./scripts/code-cli.sh serve-web
- First, I encountered Cargo missing #210454 when running in the Devcontainer.
- After manually installing Rust within the container, I only get
error error getting latest version: Updates are are not available: no configured quality
.
@mering from what I can tell, your change seems to work. Serving at / with assets at whatever the server-base-path is
@michaelneely how did you get past "error error getting latest version: Updates are are not available: no configured quality"?
I spent the whole day trying to get a testing environment on main but everything I tried (code-cli.sh
, cargo
, gulp compile-cli
, ...), I always get stuck at this error. When setting VSCODE_CLI_QUALITY=insiders
this downloads the frontend part instead of using it from my branch.
@mering I just manually updated the .js file in the running web server with your change.
It would be great if one could run web server behind a proxy. Currently, it doesn't find assets correctly. There are several options to solve this:
VSCODE_PROXY_URI
environment variable and patch)The current implementation of base path (#165391, #202491) is not sufficient as I explained in https://github.com/microsoft/vscode/pull/202491#issuecomment-2016531665 and following.