SSH port forwarding #330
Replies: 1 comment 1 reply
-
|
Hi, you're missing a few parts. Currently, your program can only handle a single connection. You need to To save yourself some trouble, you can turn a The |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I want to implement SSH port forwarding scenario. For typical administrative tasks, where you must connect to some service through jump host and to do it expose it as local port. Here is my working (yay!) code so far. I'm fairly new to Rust so I've created flow deliberately stripped of any abstractions to understand it better.
Questions:
tcpip_forwarddescribed asRequests the server to open a TCP/IP forward channelandchannel_open_direct_tcpipdescribed asOpen a TCP/IP forwarding channel.datacallback inClient::Handlertrait?breakwhen local socket read size is 0 (otherwise it's always selectable handle fortokio::select) so I never actually receiveChannelMsg::ExitStatus. That's why I added explicitcloseafter loop. But this feels hacky.local_portthough? Will Client distinguish where data from the same originator should go?server_channel_open_forwarded_tcpip/server_channel_open_direct_tcpipmethods for inClient::Handlertrait? If I implement them for Client they never get called.Thank you in advance for reviewing this code (and pushing me in right direction if I messed something up). And thank you for your time and effort creating this module.
Beta Was this translation helpful? Give feedback.
All reactions