-
Notifications
You must be signed in to change notification settings - Fork 5.9k
[Feat]: Support {{host}} in proxy-uri argument #6218
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
Comments
Cool idea, I bet we could also support #6195 with this. |
Any help wanted to implement this feature? I have use for that as well (well not this one, but the other one you referenced). I would change it, in the way that you can simply define anything you want while supporting matchers like this (not a regex, just wildcard match):
There could also be a host variable, but I'm not sure if there is already such information somewhere in the configuration. That cannot be determined automatically, except after startup someone visits the editor and at that point this variable is set. But I'm not sure if there would be any benefit of doing so. The domain shouldn't be resolved to the IP of code-server in the first place if it should no reach code-server. And even if it does in an unintented way, I don't see a security problem here. The proxy requires authentication anyway. |
Ah, we still need the host info for the PORTS tab... ok in that case it might really be a better idea to use {{ host }} instead of *, while in the matchers that would just be interpreted in the same way as I described above. |
Help is welcome for sure! The current syntax for The cases you describe make sense to me! |
What is your suggestion?
Currently, we can use {{port}}.domain.com as proxy uri to replace domain.com/proxy/{{port}} pattern.
It would be nice to support --proxy-uri={{port}}.{{host}}, where {{host}} will be replaced will be replaced by current domain.
Why do you want this feature?
I'm using ngrok to access my code-server outside of home, and it doesn't provide persistent subdomain on free plan. Allowing {{port}}.{{host}} will easily allow this instead of requiring manual configuration on every restart.
Are there any workarounds to get this functionality today?
Manually update the host, every time ngrok changes the url.
Are you interested in submitting a PR for this?
I don't have any test environment setup for coder, but the changes need to be around this line:
https://github.com/coder/code-server/blob/main/patches/proxy-uri.diff#L128
The text was updated successfully, but these errors were encountered: