-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Allow forwarding ports via URL #1309
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
Comments
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. |
@Rekrii Could you share the contents of the nginx.conf ? Thanks very much! |
@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. |
@Rekrii You might consider
for general port forwarding. |
Fixed once #1453 is merged. |
@code-asher Thanks for the great work on #1453. I think |
@benz0li Thanks! I didn't mention it in the PR but |
@benz0li oh that's much cleaner - thanks! |
It's been merged 🎊 |
#512
So like
localhost:8080/port/8080
to access port 8080 view HTTP.The text was updated successfully, but these errors were encountered: