8 ms·
Is there any stand-alone open source version of the VS Code port forwarder? That’s what I really want. Not so much public access, just local access to ports on
by CGamesPlay 3y ago
Is there any stand-alone open source version of the VS Code port forwarder? That’s what I really want. Not so much public access, just local access to ports on the remote machine that I can easily manage. SSH port forwards don’t work inside docker dev environments (and docker containers have to be rebuilt to export new ports natively), so some extra software is needed.
- SparkyMcUnicorn 3y agoUsing tailscale can solve this problem, and that's what I've opted to do since I was using tailscale already.
- CGamesPlay 3y agoA (potentially minor) problem with this use case for Tailscale is that we do actually want the forwarded services listening on localhost and not on a different IP address, because browsers treat these as secure contexts without having to fuss with https. I briefly checked the Tailscale userspace docs just now and it seems to expose a SOCKS proxy, meaning that we'd need an extra piece to listen on the desired localhost port and forward via Tailscale. [edit] Removed an incorrect assumption. Tailscale does not require CAP_NET_ADMIN in userspace mode.
- SparkyMcUnicorn 3y agoYou could also use MagicDNS with https[0], although that might not solve it the way you'd prefer. [0] https://tailscale.com/kb/1153/enabling-https https://tailscale.com/kb/1153/enabling-https
- apitman 3y agoI haven't tried vscode forwarding. What features does it have that are missing from most of the options on the list[0]? If you want a nice GUI for remote managing maybe check out one of my tools, boringproxy [0]: https://github.com/anderspitman/awesome-tunneling https://github.com/anderspitman/awesome-tunneling
- CGamesPlay 3y agoI've got your list saved in my notes :) The main thing is many of these are, well, ngrok alternatives: put my localhost on the internet. I am looking for something that puts remote ports into my local machine, and in particular which don't require configuring network interfaces (insecure to do in Docker containers) and don't require a centralized control plane.
- apitman 3y agoAh interesting. What's a typical use case for something like this? I could probably thing of a couple but I'm curious what people actually use it for.
- CGamesPlay 3y agoDevcontainers in Docker. With Docker, you cannot add a port forward to an existing container; you have to rebuild the container. With devcontainers, this at a minimum requires a few minutes of rebuilding time (an excessive price to pay for changing a port forward).
- apitman 3y agoSo you have a devcontainer running on your local machine, and you start up a service inside it and want to access it from outside?
- CGamesPlay 3y agoYes, that's the gist, although to complicate things I actually have the devcontainer running on a remote machine. So to access it I use `ssh host docker exec -it container`, for example. This is a supported workflow for VSCode remote devcontainers, and I would like to see an open-source version of it.