ssh
ssh copied to clipboard
Add localforward example
I want to implement an SSH server to forward a remote server's port to local (aka local forward), then I found an example called remoteforward, and it uses LocalPortForwardingCallback
setting.
When I try to use the example to bind local port and use curl
to request,
ssh -L 0.0.0.0:8080:example.com:80 localhost -p 2222
curl localhost:8080
Got error
channel 2: open failed: unknown channel type: unsupported channel type
Then I found it cannot be used in local forward, and the LocalPortForwardingCallback
in this example kinda useless and bring some confuse.
So I remove the LocalPortForwardingCallback
in remoteforward example and add a new example called localforward
@XSAM Thanks! Helped me a lot!