Open SSH connection on specific network interface (JSch)

心不动则不痛 提交于 2019-12-11 12:45:40

问题


How can I configure JSch client to communicate using network interface other than default one?


回答1:


I do not think that it is possible. I have the same requirement and checked the source code provided along with JSch. The plain Socket is created without a local address or port.




回答2:


You can implement the SocketFactory interface to create a custom socket with a specified source interface, and then use session.setSocketFactory(...) to plug it into your JSch session.



来源:https://stackoverflow.com/questions/8558833/open-ssh-connection-on-specific-network-interface-jsch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!