Hi, I'm new guy, I'm try to use Forwarded Port Dynamic as code below
SshClient client = new SshClient("myhost", "myuser", "mypass");
client .Connect();
if(client.IsConnected)
{
ForwardedPortDynamic f = new ForwardedPortDynamic("localhost", 9951); //my port
client .AddForwardedPort (f);
f.Start();
//Then I use localhost:9951 as Http proxy
HttpWebRequest rq = (HttpWebRequest)WebRequest.Create("http://google.com");
rq.Proxy = new WebProxy("localhost:9951");
HttpWebResponse rp = (HttpWebResponse)rq.GetResponse();
f.Stop();
}
My problem: I can't get response.
Sorry about my english, I'm realy new guy.
SshClient client = new SshClient("myhost", "myuser", "mypass");
client .Connect();
if(client.IsConnected)
{
ForwardedPortDynamic f = new ForwardedPortDynamic("localhost", 9951); //my port
client .AddForwardedPort (f);
f.Start();
//Then I use localhost:9951 as Http proxy
HttpWebRequest rq = (HttpWebRequest)WebRequest.Create("http://google.com");
rq.Proxy = new WebProxy("localhost:9951");
HttpWebResponse rp = (HttpWebResponse)rq.GetResponse();
f.Stop();
}
My problem: I can't get response.
Sorry about my english, I'm realy new guy.