Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: Weird problem on SSH Port Forwarding

$
0
0

Hi,

 

I think the example you provided will not compile.

 

I just tried this code:

using (SshClient sshClient = new SshClient(connectionInfo))
            {
                sshClient.Connect();var fowardPort = new ForwardedPortLocal("127.0.0.1", 10000, "www.cnn.com", 80);
                sshClient.AddForwardedPort(fowardPort);var fowardPort2 = new ForwardedPortLocal("127.0.0.1", 10001, "www.cnn.com", 80);
                sshClient.AddForwardedPort(fowardPort2);var fowardPort3 = new ForwardedPortLocal("127.0.0.1", 10002, "www.cnn.com", 80);
                sshClient.AddForwardedPort(fowardPort3);

                fowardPort.Start();
                fowardPort2.Start();
                fowardPort3.Start();
                Thread.Sleep(1000 * 60 * 5);

                sshClient.Disconnect();
            }

And all worked as expected.

I managed to go to http://localhost:10000/, http://localhost:10001/ and http://localhost:10002/ on my local machine with no problem.

 

Can you please provide compilable example that you using where it does not work.

 

Thanks,

Oleg


Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>