This project is read-only.

Dynamic Port Forwarding (SOCKS proxy)

Oct 13, 2015 at 8:52 AM
Hi,

I've written the following code:
Inline Code
public partial class frmPrimary : Form
{
        SshClient mainClient;
        ForwardedPortDynamic mainForwardedPort;

        public frmPrimary()
        {
            InitializeComponent();
        }

        private void btnConnect_Click(object sender, EventArgs e)
        {
            //Initialize SSH connection
            mainClient = new SshClient("xxx.xxx.xxx.xx", txtUser.Text, txtPassword.Text);
            mainForwardedPort = new ForwardedPortDynamic("127.0.0.1", 9999); //Dynamic Proxy port
            mainClient.Connect();
            mainClient.AddForwardedPort(mainForwardedPort);
            mainForwardedPort.Start();
        }
}
The connection is established and login successful, but I'm unable to pass my data through the SOCKS proxy, although I could do the same when I use PuTTy Dynamic Port Forwarding

The proxy in Firefox is set to 127.0.0.1 with port 9999 (SOCKS proxy), it works fine with PuTTy Dynamic Port Forwarding, but doesn't work at all with my code.

Could you please tell me what's wrong?