Skip to content

use VSCODE_PROXY_URI for domainProxy, allow {{host}} replacement #6225

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

Merged
merged 4 commits into from
May 31, 2023

Conversation

smerschjohann
Copy link
Contributor

Fixes #6218
Fixes #6195

this enables support for VSCODE_PROXY_URIs like https://code-{{port}}.{{host}}

@smerschjohann smerschjohann requested a review from a team as a code owner May 20, 2023 11:02
this enables support for VSCODE_PROXY_URIs like https://code-{{port}}.{{host}}
@codecov
Copy link

codecov bot commented May 22, 2023

Codecov Report

Merging #6225 (b478fdb) into main (b3b9714) will decrease coverage by 0.40%.
The diff coverage is 60.60%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6225      +/-   ##
==========================================
- Coverage   73.00%   72.61%   -0.40%     
==========================================
  Files          30       30              
  Lines        1730     1749      +19     
  Branches      384      387       +3     
==========================================
+ Hits         1263     1270       +7     
- Misses        391      402      +11     
- Partials       76       77       +1     
Impacted Files Coverage Δ
src/node/main.ts 49.47% <33.33%> (+0.01%) ⬆️
src/node/routes/domainProxy.ts 50.98% <55.00%> (-9.02%) ⬇️
src/node/cli.ts 90.97% <77.77%> (-0.57%) ⬇️
src/node/http.ts 70.80% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 74af05d...b478fdb. Read the comment docs.

Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Implementation looks solid to me but I think we should base this off the proxy-domain values rather than the environment variable (see below).

We should also consider adding some text to the proxy-domain help mentioning that you can use {{port}} and {{host}}.

@Vaibhav1919
Copy link

@smerschjohann @code-asher Any Update on this Issue?

@code-asher
Copy link
Member

@Vaibhav1919 Will be looking at the changes today.

Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I think we just need to figure out what we want to do with regards to host vs hostname and we are good to go. There are also some formatting changes and I think we need to update some of the unit tests that test the --proxy-domain flag.

I like how the {{port}} is part of the output now if you do something like --proxy-domain test.com because it makes it very clear what exactly is being forwarded.

As a separate thing, I noticed that manually forwarding a port does not seem to use the proxy URI but this seems to be an existing bug so I will open a new issue for that.

@smerschjohann
Copy link
Contributor Author

I'm done, hopefully the pipeline tells us the same ;)

@code-asher code-asher enabled auto-merge (squash) May 31, 2023 21:02
@code-asher code-asher disabled auto-merge May 31, 2023 21:31
@code-asher code-asher merged commit 0703ef0 into coder:main May 31, 2023
@code-asher
Copy link
Member

Thanks again!

@smerschjohann
Copy link
Contributor Author

No problem!

@smerschjohann smerschjohann deleted the feat-6218 branch June 1, 2023 17:19
yiliang114 pushed a commit to yiliang114/code-server that referenced this pull request Jan 23, 2025
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

Successfully merging this pull request may close these issues.

[Feat]: Support {{host}} in proxy-uri argument Support proxying ports without separate sub-domains
3 participants