-
Notifications
You must be signed in to change notification settings - Fork 285
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
Allow specifying DNS names in addition to ports that should be forwarded #3450
Comments
//cc: @kieferrm @roblourens @mjbvz - FYI, the specific scenario here is wanting to use SSL certificates locked to a host name, but the host name is set to 127.0.0.1 via a hosts file both remotely and locally (or corp DNS). The request is to be able to have the "click on link" feature in the terminal or when a browser is opened via launch.json to work in the scenario, while now we only consider |
@bamurtaugh @Chuxel I am not sure if this is related, but having ability to forward DNS along with ports would be very helpful. For instance, if I use kubefwd in my VM with remote ssh, and it forwards all the cluster urls at Currently, I don't think it is possible since I can only forward ports via VSCode. Doing this manually via a Socks5 proxy across a SSH with IAP Tunnel as of now. Adding this may be really helpful. |
@tvvignesh I'd suggest we pull that out into a separate issue since its local to remote. This is more remote to local. I tweaked the subject because we've seen an expansion in where this is needed when it comes to Docker Compose - particularly with Codespaces in addition to Remote - SSH. This Docker Compose case makes the problem really obvious, so we'll use that - but the same types of issues exist in the Remote - SSH case as well. ExampleIn terms of a concrete example here, let's take a look at a typical Docker Compose definition. This is what you'd normally want to be able to do: services:
app:
build:
context: ..
dockerfile: .devcontainer/Dockerfile
volumes:
- ..:/workspace:cached
command: sleep infinity
db:
image: postgres:latest
restart: unless-stopped
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: postgres
POSTGRES_DB: postgres
POSTGRES_PASSWORD: postgres
volumes:
postgres-data: If you connect to the {
"forwardPorts": [ "5432" ]
} The same is true for automated forwarding and if you use the forward ports UI. Why? Because this port is available at Today we have a hack in place in our vscode-dev-containers definitions that uses the same network for all containers. This results in Ideally, you'd be able to do the following: {
"forwardPorts": [ "db:5432" ]
} This would then need support in the UI as well. Auto-forwardingIts unclear if we can automatically detect this scenario and auto-forward, but it's also worth noting that these URIs will show up in debug output and the terminal. So, we would want a declarative way to indicate which domains/IPs should be treaded like they are in the container. Consider this terminal output:
Clicking on Perhaps devcontainer.json could include something like this to make this possible: {
"otherPortsAttributes": {
"autoForwardDomains": [
"db",
"my.domain.in.etc.hosts",
"142.134.1.22"
]
}
} Remote - SSHThere have been similar asks for Remote - SSH, but in this case devcontainer.json is not available. That said, the I also would assume we would want to include the option to specify a different domain in the general port forwarding UX so it could be used across the board for more ad-hoc use that would be typical for Remote - SSH. |
Some part of this is now done via microsoft/vscode#131399. It is now possible (at the low-level layer) to create a tunnel to a destination host that is reachable via the remote machine's network. |
What already works:
What needs work:
|
Feature that allows you to specify DNS names (other than “localhost.*") that resolve to 127.0.0.1 and that are then auto-forwarded.
I searched through existing issues and didn't seem to find one, but please feel free to let me know if I might've missed one.
cc @Chuxel
The text was updated successfully, but these errors were encountered: