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 ports forwards #110

Open
Dragonox77 opened this issue Jun 22, 2023 · 3 comments
Open

Multiple ports forwards #110

Dragonox77 opened this issue Jun 22, 2023 · 3 comments
Assignees

Comments

@Dragonox77
Copy link

Hi,

Is there a way to have multiple ports forwarding with this lib ?

Thank you

@agebrock
Copy link
Owner

I was asked that question before. I guess you want to open multiple ports on your local machine as well. So you would need multiple TCP servers.

In that case I simply advice to create multiple instances of the tunnel.

If you have something different in mind, please provide a usage example.

Thanks !

@agebrock agebrock self-assigned this Jun 23, 2023
@Dragonox77
Copy link
Author

Hi,
Many thanks for this answer;

I was thinking of transforming the tunnelOptions config variable into an array, and iterating it so you could create as much as tunnels as you need internaly, and call "conn.forwardOut" (line 80) for every entries.

What do you think ?

Thank you again

@agebrock
Copy link
Owner

agebrock commented Jul 2, 2023

This came up in the 4.x version already. The problem I see is that you need to open the ports on your local machine as well.

So for the setup you describe, I guess we need multiple tcp server, multiple forwards but only one ssh connection.

In fact I am having kind of the same requirement in one of my experiments where I would like to bind all ports from a kubernetes (or docker cluster) from a remote machine to my local one.

I think that goes into the same direction as your request.

I am reviewing the code one more time, and see how we could prepare the lib to do such thing.

Thanks for your input.

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

2 participants