Skip to content
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

Multiple LocalForward options #119

Closed
bvleur opened this issue Feb 23, 2016 · 5 comments
Closed

Multiple LocalForward options #119

bvleur opened this issue Feb 23, 2016 · 5 comments
Assignees
Milestone

Comments

@bvleur
Copy link

bvleur commented Feb 23, 2016

I would like to open 2 TCP tunnels when connected to a single host.

Using configuration like:

hosts:
  myhost:
    HostName: 1.2.3.4
    LocalForward: "3307 127.0.0.1:3306"
    LocalForward: "8080 10.1.2.3:80"

is not supported and silently (!) only uses the last LocalForward option.

It would be great if multiple forwards are accepted like (option a):

    LocalForward:
      - "3307 127.0.0.1:3306"
      - "8080 10.1.2.3:80"

I personally would like a configuration like (option b):

    LocalForward:
      3307: "127.0.0.1:3306"
      8080: "10.1.2.3:80"

(because a mapping still allows for inheritance and overriding specific keys)

@moul moul self-assigned this Feb 23, 2016
@moul
Copy link
Owner

moul commented Feb 23, 2016

HI @bvleur, thank you for reporing,

I also prefer the option B, I need to give some tests here, I will probably have limitaions with the yaml specifications

@moul moul modified the milestones: v2.3.0, Proposal Mar 21, 2016
@scoates
Copy link

scoates commented Aug 25, 2016

FWIW, this hack works in the meantime (it's ugly but it works):

hosts:
  myhost:
    HostName: 1.2.3.4
    LocalForward: "3307 127.0.0.1:3306\n  LocalForward: 8080 10.1.2.3:80"

@moul
Copy link
Owner

moul commented Oct 15, 2016

Hi, you can now use one (string) or multiple (list) LocalForward per hosts

Can you give a try ?

PS: I decided to implement the option A, because it's more generic, I also applied this change to every single-or-multiple options

@pschmitt
Copy link
Contributor

Hi,

what would be the correct way to set a LocalForward config rule that does the same as
-L '*:10051:localhost:10051' would on the command line?

@moul
Copy link
Owner

moul commented Jan 19, 2017

Hi @pschmitt, LocalForward accepts strings or array of strings, so in flexible yaml it can be one of the three following methods:

hosts:

  aaa:
    LocalForward: '*:10051:localhost:10051'

  bbb:
    LocalForward:
    - *:10051:localhost:10051
    - *:10052:localhost:10052

  ccc:
    LocalForward: ['*:10051:localhost:10051', '*:10052:localhost:10052']

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants