Skip to content

[Feat]: Allow custom path re-write on absproxy #6898

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

Closed
rafaelnferreira opened this issue Jul 13, 2024 · 3 comments
Closed

[Feat]: Allow custom path re-write on absproxy #6898

rafaelnferreira opened this issue Jul 13, 2024 · 3 comments
Labels
duplicate enhancement Some improvement that isn't a feature

Comments

@rafaelnferreira
Copy link
Contributor

What is your suggestion?

Scenario: I've deployed code server under a path under your domain, the path structure is suffixed for each user id. For example:

http://mydomain.com/vscode --> app served here
http://mydomain.com/vscode/user1 --> url for individual user

While trying to serve a react app, I've noticed that requests were stripping out the vscode/user1, hence not hitting the webpack server in the react app with the right path.

This is the intended behaviour of pathProxy.ts

Suggestion: Allows a generic argument to be set while starting the server that will accept a regex to enrich the path forwarded by the absproxy , eg something like: --absproxy-prefix, if this variable is set, the pathProxy will make use of it and forward the request after enrichment.

Why do you want this feature?

To simplify the deployment structure and allow get rid of the intermediary proxy.

I believe this feature will also benefit other users that are constrained on deployment code server using a proxy domain, as the path approach is simpler and easy to navigate from a enterprise security perspective.

Are there any workarounds to get this functionality today?

Yes, uses one additional reverse proxy next to vs code server, however the UX isn't great.

Are you interested in submitting a PR for this?

Yes

@rafaelnferreira rafaelnferreira added the enhancement Some improvement that isn't a feature label Jul 13, 2024
@code-asher
Copy link
Member

Would #6770 cover this?

So right now we have:

  • /proxy/3000/path/ -> gets rewritten to /path/
  • /absproxy/3000/path/ -> no rewriting, gets forwarded as /absproxy/3000/path/

Then with the proposed base path flag, for example --base-path /base/path:

  • /proxy/3000/path/ -> no change, still gets rewritten to /path/
  • /absproxy/3000/path/ -> gets reritten to /base/path/absproxy/3000/path/

@rafaelnferreira
Copy link
Contributor Author

@code-asher yes it certainly does. Is that being scheduled?

@code-asher
Copy link
Member

Cool, I will close this as a duplicate of #6770.

It is not being scheduled, mostly our work here is just keeping the VS Code version up to date, but always happy to merge a PR!

@code-asher code-asher closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate enhancement Some improvement that isn't a feature
Projects
None yet
Development

No branches or pull requests

2 participants