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
Currently I do this via a reverse proxy (nginx or similar) on the host box to forward /8080 URL to :8080 the code-server instance, and then an nginx server in CS to host whatever the user (me) wants. Very neat and simple. Not sure how scaleable it is if you needed 10k+ ports.
Comes down to if CS needs to be a swiss army knife of tools, or just a base IDE and you add stuff yourself (e.g. nginx as above).
I think we'll have a lot of benefits having a port forwarding proxy since its been a long overdue request by the community for us. Though I'd prefer we do it as a VS Code extension since its more suitable to do it in VS Code's own APIs AFAIK.
This way i forward a single port, 80, to my nginx RP, and it can then do basic-auth where i need (for my code-server instance) and have it hand connections to different ports internally.
Also ensure all SSL config is secure; ciphers, etc are good (I use Qualsys SSL Labs test).
As i mentioned above, this won't scale too well into a large number of ports. But I use this to test/host different prototype projects I'm working on - normally say 10 or so, so i can manually do this port forward setup for such a small number.
Activity
Rekrii commentedon Jan 28, 2020
Currently I do this via a reverse proxy (nginx or similar) on the host box to forward /8080 URL to :8080 the code-server instance, and then an nginx server in CS to host whatever the user (me) wants. Very neat and simple. Not sure how scaleable it is if you needed 10k+ ports.
Comes down to if CS needs to be a swiss army knife of tools, or just a base IDE and you add stuff yourself (e.g. nginx as above).
sr229 commentedon Jan 28, 2020
I think we'll have a lot of benefits having a port forwarding proxy since its been a long overdue request by the community for us. Though I'd prefer we do it as a VS Code extension since its more suitable to do it in VS Code's own APIs AFAIK.
zhpengfei commentedon Feb 15, 2020
@Rekrii Could you share the contents of the nginx.conf ? Thanks very much!
Rekrii commentedon Feb 25, 2020
@zpfei206 Sorry I was on holiday. See below:
I use something simple like this in an nginx instance running in code-server:
On the nginx reverse proxy i use:
This way i forward a single port, 80, to my nginx RP, and it can then do basic-auth where i need (for my code-server instance) and have it hand connections to different ports internally.
Also ensure all SSL config is secure; ciphers, etc are good (I use Qualsys SSL Labs test).
As i mentioned above, this won't scale too well into a large number of ports. But I use this to test/host different prototype projects I'm working on - normally say 10 or so, so i can manually do this port forward setup for such a small number.
benz0li commentedon Mar 27, 2020
@Rekrii You might consider
for general port forwarding.
kylecarbs commentedon Mar 27, 2020
Fixed once #1453 is merged.
benz0li commentedon Mar 27, 2020
@code-asher Thanks for the great work on #1453.
I think
/p/<number>would be preferable to<number>.[domain]as it remained compatibility running Code Server on Jupyter using Jupyter Server Proxy.code-asher commentedon Mar 27, 2020
@benz0li Thanks! I didn't mention it in the PR but
/proxy/<number>will also work.Rekrii commentedon Mar 28, 2020
@benz0li oh that's much cleaner - thanks!
kylecarbs commentedon Apr 14, 2020
It's been merged 🎊