Issue Type: Feature Request
Port forwarding should let me specify a different local port from remote port so that I can forward 80/443, etc from the remote machine to my local.
Extension version: 0.42.2
VS Code version: Code 1.35.1 (c7d83e57cd18f18026a8162d042843bda1bcf21f, 2019-06-12T14:30:02.622Z)
OS version: Windows_NT x64 10.0.16299
Remote OS version: Linux x64 3.10.0-957.1.3.el7.x86_64
Which remote extension are you using?
The remote development ssh extension
On Fri, Jun 21, 2019, 1:33 AM Erich Gamma notifications@github.com wrote:
Which remote extension are you using?
โ
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/vscode-remote-release/issues/761?email_source=notifications&email_token=AA4RLJAV7D6DIITDQULBOI3P3SG5PA5CNFSM4H2I5QUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYH2LZI#issuecomment-504341989,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AA4RLJCUB2NKFWZDK57WPVLP3SG5PANCNFSM4H2I5QUA
.
I'd just like to leave a small wish here that VS Code doesn't grow a strong dependency on reverse/remote port forwarding. My experience with getting VS Code accepted with IT in a big enterprise was that AllowTcpPorwarding=local was an acceptable sshd setting that they were willing to roll out, but nothing more.
Hey @ethanspitz,
I was just wishing for the same feature too, and found this feature request.
However after some digging, I figured out it already exists! ๐
First forward a port, then right click on it and select Change Local Port:

And I found its original commit at: https://github.com/microsoft/vscode/commit/b72188e25779fe5c165591e0f653cc04cbb349c9
Unfortunately, I don't believe it's documented at either:
Although, now I'm considering just writing it up and adding at:
https://github.com/microsoft/vscode-docs/blob/master/docs/remote/ssh.md#forwarding-a-port--creating-ssh-tunnel
Oh cool! Thanks for letting me know! I'll have to set that up next time I
do some port forwarding
On Tue, Jun 16, 2020, 7:50 PM Jeremy Glenn Lopez notifications@github.com
wrote:
Hey @ethanspitz https://github.com/ethanspitz,
I was just wishing for the same feature too, and found this feature
request.
However after some digging, I figured out it already exists! ๐First forward a port, then right click on it and select Change Local
Port:
[image: vscode-ssh-tunnel-different-local-port]
https://user-images.githubusercontent.com/18109684/84848153-8290aa80-b007-11ea-9378-375cbce5dde1.pngUnfortunately, I don't believe it's documented at either:
-
https://code.visualstudio.com/docs/remote/ssh#_forwarding-a-port-creating-ssh-tunnelAlthough, now I'm considering just writing it up and adding at:
https://github.com/microsoft/vscode-docs/blob/master/docs/remote/ssh.md#forwarding-a-port--creating-ssh-tunnel
โ
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/microsoft/vscode-remote-release/issues/761#issuecomment-645115427,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AA4RLJCLA2CGFJ2U3IFSXBDRXAVONANCNFSM4H2I5QUA
.
FYI, I just finished writing the docs up! ๐
See PR: https://github.com/microsoft/vscode-docs/pull/3788
@jglopez, fantastic find. Now that it is obvious it is easily accomplished and the ability already exists in VSCode, we should improve the "Forward a Port" in the Command Palette to allow accepting a different local port.
This issue has been marked for ssh specifically, however it applies to Dev-Containers just the same.
Currently from Command Palette the "Forward a Port" currently only accepts a single number:
For example:
8080
This should be changed to allow both a single number or two colon delimited numbers:
For example:
8080
80:8080
The 8080 would continue to create port forwarding for 8080 -> localhost:8080 as it does today, however the second "80:8080" version would create port forwarding for 8080 -> localhost:80.
@tolgabalci Yeah, I was wishing for the exact same functionality/syntax too. I was slightly disappointed the current implementation only allows changing the local port after the fact, and not exactly "when setting up port forward"... if you're taking this feature request's title literally word for word.
However, I'm very happy regardless the functionally exists at all. (And write the docs for it ๐)
After I learned it exists, this changed from an "absolutely necessary" to a "nice to have".
At the end of the day, I personally am not _too inconvenienced_ by a few more mouse clicks.
I'd leave it to the VS Code product managers to decide on closing this and reopening a new Issue (as it technically already exists), or leaving it open for our specific use case.