-
Notifications
You must be signed in to change notification settings - Fork 5.7k
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
feat: enable forwarded ports using built-in proxy #5673
Conversation
This makes the forwarded ports panel enabled by default.
This adds a `tunnelProvider` along with a `tunnelFactory` so that ports are forwarded and use code-server's built-in proxy.
This adds a check in our `resolveExternalUri` patch to skip modifying if the `authority` and the `location.host` match to prevent `localhost:<port>/proxy/<port>` from being modified.
433ff31
to
b98bebb
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #5673 +/- ##
=======================================
Coverage 72.61% 72.61%
=======================================
Files 30 30
Lines 1680 1680
Branches 368 368
=======================================
Hits 1220 1220
Misses 397 397
Partials 63 63 Continue to review full report at Codecov.
|
npm install --unsafe-perm @coder/code-server-pr@4.7.1-5673-3c17798eb377432f160f3aef7cad61bb2a26a83f |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very exciting 🎉
For some reason I am not seeing the ports panel (tried npm
and the CI artifact). 🤔
$ code-server --auth none
[2022-10-21T15:48:23.934Z] info code-server 4.7.1-5673-3c17798eb377432f160f3aef7cad61bb2a26a83f 3c17798eb377432f160f3aef7cad61bb2a26a83f
Hmm...do you have it hidden by chance? @bpmct and I did test it in a v2 workspace (Linux) and we saw it. I'm not sure what else might cause it to be missing 🤔 |
here are the steps we did: coder/coder@main...dogfood-code-server-ports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently I was having a caching issue. Works for me now!
We might want to edit
|
Good point! I'll do that and then merge |
FWIW: I have been experiencing potential issues with this PR on systems in which the code-server is running behind another proxy. Websocket connections are constantly being disconnected and reconnected at a high rate making the UI inaccessible and rendering the application unusable. I will open another issue for this, but wanted to share in this thread as well. Having an optional kill switch for this feature might be beneficial for folks like myself who would prefer to opt out so we can stay current with code-server, otherwise!
|
I didn't consider that when I merged this - great point! I'll keep an eye out for that issue. |
Description
This PR enables the forwarded ports panel in Code and then adds a
tunnelFactory
to forward them using code-server's built-in proxy (/proxy/port
).One thing to note: it seems ports will not be "un-forwarded" due to a limitation upstream. However, reloading code-server, they are removed. See here:
TODOs
The following things remain:
killing port should remove from ports panelthis behavior exists upstream so leaving as isVSCODE_PROXY_URI
Screenshots
Example using
VSCODE_PROXY_URI=https://{{port}}.kyle.dev
Example using Caddy to server code-server behind proxy: