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

Feature request: Provide a way to bind the SSH clients to a local IP #42

Open
psg666 opened this issue Jul 19, 2016 · 1 comment
Open

Comments

@psg666
Copy link

psg666 commented Jul 19, 2016

Hi,

Would you consider adding LocalIP (and LocalPort defaulting to 0) property to the ConnectInfo? I have a multi-IP server and need to bind to a particular IP for the SFTP to go thru the firewall.
I know that Socket.Bind is not supported by all target frameworks.

I ended up modifying the ConnectInfo with the two properties, the PasswordConnectionInfo to add the necessary constructors, the Session.SocketConnect to optionally construct an IPEndPoint and the SocketAbstraction.Connect to pass the local EndPoint and do a socket.Bind.
I used FEATURE_SOCKET_SYNC to surround the socket.Bind to make the code compile.
Of course this is a hack for my needs only.

@DDinVA
Copy link

DDinVA commented Aug 31, 2016

@psg666 can you post what you did. I need it too!

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

3 participants