Skip to content

Allow specifying local port when setting up port forward #761

Closed

Description

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

Activity

  1. added
    info-needed
    on Jun 21, 2019
  2. egamma commented on Jun 21, 2019

    @egamma
    Member

    Which remote extension are you using?

  3. ethanspitz commented on Jun 21, 2019

    @ethanspitz
    Author
  4. added
    ssh
    and removed
    info-needed
    on Jun 21, 2019
  5. davidwin commented on Jun 23, 2019

    @davidwin

    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.

  6. changed the title [-]Make port forwarding great again.[/-] [+]Allow specifying local port when setting up port forward[/+] on Jul 26, 2019
  7. added
    feature-request
    on Jul 26, 2019
  8. jglopez commented on Jun 17, 2020

    @jglopez

    Hey Ethan Spitz (@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:
    vscode-ssh-tunnel-different-local-port

    And I found its original commit at: microsoft/vscode@b72188e

    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

  9. ethanspitz commented on Jun 17, 2020

    @ethanspitz
    Author
  10. jglopez commented on Jun 17, 2020

    @jglopez

    FYI, I just finished writing the docs up! 😄
    See PR: microsoft/vscode-docs#3788

  11. tolgabalci commented on Jul 19, 2020

    @tolgabalci

    Jeremy Glenn Lopez (@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.

  12. jglopez commented on Jul 19, 2020

    @jglopez

    Tolga Balci (@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.

  13. dennisleung commented on Jan 18, 2021

    @dennisleung

    every time i restart dev server on remote machine, my local forward port changed.
    this is very annoying...
    is there any way for me to specific the local forward port and make it stable?

  14. tanhakabir commented on Oct 29, 2021

    @tanhakabir

    dennisleung (@dennisleung) hm sorry about that! If you're still facing that issue, it would be great if you could file an issue for it.

    I'm going to close this issue since it seems like the request is already supported now. Let me know if any of you think otherwise!

  15. locked and limited conversation to collaborators on Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestssh

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions