You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For me there's really no use case to secure the proxied ports, but I do like code-server running behind authentication wall so I don't want to disable the whole thing. It'd be great if there was an option like code-server --disable-proxy-auth that would allow /proxy/<port> requests to go through.
A command line flag feels like an unfortunate way to implement this to me (definitely easy though) so in my mind we'd add to our /api endpoint (/api/proxy maybe) a way to list/add/remove/auth/deauth proxied ports and then write a very simple VS Code plugin that we ship as a built-in which lets you manage the proxy using that API endpoint.
@code-asher I agree with you! However, I think it's still better to have a stopgap --no-proxy-auth flag than to not support it at all. Or perhaps, --proxy vs. --proxy-without-auth.
I'm on the fence; I would definitely rather not have to maintain a feature we only added as a stop-gap. 😄
I'm also quite wary of a feature that disables auth entirely for the proxy since that defeats having auth at all (you can proxy code-server itself, for example).
We could have the flag take port numbers instead but personally I feel doing it properly from the get-go is the right answer. I'll go ahead and add this to the next milestone; if someone doesn't take it in the next week or so I'll put it on my todo list. It'd be great to have our own built-in plugin anyway for adding other features into VS Code that we've been wanting.
Actually proxying to code-server wouldn't let you in, you'd just get the login page...not sure what I was thinking there. I do think it's sketchy though since you can access any port on the machine without authenticating which sounds like a security nightmare. 😆
@code-asher I'm running a multi-user VSCode setup (using code-server on Docker Swarm) sitting behind Traefik (a load balancer), so this is where I'm coming from. Right now I manually create a rule for say, p3000.mydomain.com to point to port 3000 on the instance (and mydomain.com points to port 8080 on the instance).
Activity
nhooyr commentedon Aug 17, 2020
Yea some UI around here to control which ports can be proxied and with or without auth would be really nice.
avaidyam commentedon Mar 22, 2021
@nhooyr Has there been any progress on this? If not, where would the relevant code be so that I may take a peek?
code-asher commentedon Mar 22, 2021
We haven't done anything here yet.
Authentication for the path proxy:
https://github.com/cdr/code-server/blob/32d882a50740e200eb1ba169d3a0bdcf2eeffc1e/src/node/routes/pathProxy.ts#L25
Authentication for the domain proxy:
https://github.com/cdr/code-server/blob/32d882a50740e200eb1ba169d3a0bdcf2eeffc1e/src/node/routes/domainProxy.ts#L42
A command line flag feels like an unfortunate way to implement this to me (definitely easy though) so in my mind we'd add to our
/apiendpoint (/api/proxymaybe) a way to list/add/remove/auth/deauth proxied ports and then write a very simple VS Code plugin that we ship as a built-in which lets you manage the proxy using that API endpoint.avaidyam commentedon Mar 22, 2021
@code-asher I agree with you! However, I think it's still better to have a stopgap
--no-proxy-authflag than to not support it at all. Or perhaps,--proxyvs.--proxy-without-auth.code-asher commentedon Mar 23, 2021
I'm on the fence; I would definitely rather not have to maintain a feature we only added as a stop-gap. 😄
I'm also quite wary of a feature that disables auth entirely for the proxy since that defeats having auth at all (you can proxy code-server itself, for example).
code-asher commentedon Mar 23, 2021
We could have the flag take port numbers instead but personally I feel doing it properly from the get-go is the right answer. I'll go ahead and add this to the next milestone; if someone doesn't take it in the next week or so I'll put it on my todo list. It'd be great to have our own built-in plugin anyway for adding other features into VS Code that we've been wanting.
code-asher commentedon Mar 23, 2021
Actually proxying to code-server wouldn't let you in, you'd just get the login page...not sure what I was thinking there. I do think it's sketchy though since you can access any port on the machine without authenticating which sounds like a security nightmare. 😆
avaidyam commentedon Mar 23, 2021
@code-asher I'm running a multi-user VSCode setup (using code-server on Docker Swarm) sitting behind Traefik (a load balancer), so this is where I'm coming from. Right now I manually create a rule for say,
p3000.mydomain.comto point to port 3000 on the instance (andmydomain.compoints to port 8080 on the instance).[-]A way to disable authentication for proxied ports[/-][+]Add UI around ports[/+]stale commentedon Dec 1, 2021
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.
stale commentedon May 31, 2022
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.