devpod
devpod copied to clipboard
Question: why is localhost access only available when connected via ssh
I am running my devpod container with ide none and provider docker.
I have the following in .devcontainer.json:
"forwardPorts": [8080],
If I am connected to the container via ssh mypod.devpod, I can access http://localhost:8080 from my browser.
If I am not connected, the browser cannot connect to localhost:8080. Am I missing sthing ?
If it is normal, what is the reason ?
Hey @gotcha,
DevPod needs a connection to your workspace to forward the remote port to your local machine. Usually that's done when you're connecting your IDE, or ssh into the workspace. We could think about adding a background mode where we'd start a long-lasting connection in the background and keep the ports forwarded. We'll need to think that through though as it's very likely to cause port clashes
@pascalbreuninger
Are you implying that ssh-ing into the container also tunnels the forwarded ports ?
If this is the case, the only need in my opinion is to somehow document this "implementation detail" (which it is not) to avoid any misunderstanding, especially by newbies that might not have any idea about tunneling.
Are you implying that ssh-ing into the container also tunnels the forwarded ports ?
Pretty much, yep. Thanks for the feedback, we'll update the docs