Uh oh!
There was an error while loading. Please reload this page.
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.
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.
|
jsjoeio
commented
Oct 20, 2022
npm install --unsafe-perm @coder/code-server-pr@4.7.1-5673-3c17798eb377432f160f3aef7cad61bb2a26a83f |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
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
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jsjoeio
commented
Oct 21, 2022
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 🤔 |
bpmct
commented
Oct 21, 2022
here are the steps we did: coder/coder@main...dogfood-code-server-ports |
code-asher
left a comment
There was a problem hiding this comment.
Apparently I was having a caching issue. Works for me now!
We might want to edit |
jsjoeio
commented
Oct 21, 2022
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! |
jsjoeio
commented
Nov 30, 2022
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
tunnelFactoryto 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_URIScreenshots
Example using

VSCODE_PROXY_URI=https://{{port}}.kyle.devExample using Caddy to server code-server behind proxy:
