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

New Post: Using proxy

$
0
0
Thank you, I will try it the next days (currently ill) and give you feedback.
Best regards,
Sebastian



olegkap <notifications@codeplex.com> schrieb:

From: olegkap

Hi Sebastian,

I dont think I used Fiddlet before but I just checked in some code changes where I made some port forwarding improvments.

Can you try to checkout the latest version and see if it works for you?

Just as an example, I used following code to stress test my local portforwarding in case you want to recreate it for dynamic port forwarding:

using (var ssh = new SshClient(connectionInfo))
            {
                ssh.Connect();//var port1 = ssh.AddForwardedPort<ForwardedPortLocal>("localhost", 8084, "www.renci.org", 80);var port1 = new ForwardedPortLocal("localhost", 8084, "www.renci.org", 80);
                ssh.AddForwardedPort(port1);
                port1.Exception += delegate(object sender, ExceptionEventArgs e)
                {
                    Console.WriteLine(e.Exception.ToString());
                };
                port1.RequestReceived += delegate(object sender, PortForwardEventArgs e)
                {
                    Console.WriteLine(e.OriginatorHost + ":"+ e.OriginatorPort);
                };
                port1.Start();var globalCounter = 0;

                System.Threading.Tasks.Parallel.For(0, 10000,
                    new ParallelOptions
                    {
                        MaxDegreeOfParallelism = 40,
                    },
                    (counter) =>
                    {
                        Interlocked.Increment(ref globalCounter);var req = HttpWebRequest.Create("http://localhost:8084");using (var response = req.GetResponse())
                        {var r = new StreamReader(response.GetResponseStream());var output = r.ReadToEnd();
                            Console.WriteLine(string.Format("{3}\tRequest: {0}\tTime: {1}\tLength: {2}", counter, DateTime.Now, output.Length, globalCounter));
                        }
                    }
                );


                Thread.Sleep(1000 * 60 * 10);

                port1.Stop();

                ssh.Disconnect();
            }

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>