ssh icon indicating copy to clipboard operation
ssh copied to clipboard

Add localforward example

Open XSAM opened this issue 5 years ago • 1 comments

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 avatar Nov 15 '19 10:11 XSAM

@XSAM Thanks! Helped me a lot!

dcb9 avatar Apr 19 '23 14:04 dcb9