sshnet forward port dynamic problem

Sep 22, 2013 at 3:45 PM
Hello,

I using GeckoWebBrowser and i want to fake my ip location, this is my code
                Skybound.Gecko.GeckoPreferences.User["network.proxy.type"] = 1; 
                Skybound.Gecko.GeckoPreferences.User["network.proxy.share_proxy_settings"] = true;
                Skybound.Gecko.GeckoPreferences.User["network.proxy.socks"] = "127.0.0.1";
                Skybound.Gecko.GeckoPreferences.User["network.proxy.socks_port"] = 1080;
                Skybound.Gecko.GeckoPreferences.User["network.proxy.socks_remote_dns"] = true;
                Skybound.Gecko.GeckoPreferences.User["network.proxy.socks_version"] = 5; 
                Skybound.Gecko.GeckoPreferences.User["network.proxy.no_proxies_on"] = "localhost, 127.0.0.1";
My geckowebbrowser work well when i use Bitvise SSH Client to forward port dynamic (create sock5 127.0.0.1:1080)

But my geckowebbrowser error (connection timeout) when i use sshnet (i not use bitvise ssh client) to forward port dynamic, this is my code
                SshClient client = new SshClient(host, username, password);
                client.KeepAliveInterval = new TimeSpan(0, 0, 30);
                client.Connect();
                ForwardedPortDynamic port = new Renci.SshNet.ForwardedPortDynamic"127.0.0.1", 1080);
                client.AddForwardedPort(port);
                client.SendKeepAlive();
                port.Start();
                if (port.IsStarted)
                    this.geckoWebBrowser.Navigate("http://google.com");
                else
                    MessageBox.Show("Error");
Please tell me what did i wrong this code and how i fix it.

Thank you!
Oct 4, 2013 at 5:36 AM
Edited Oct 4, 2013 at 5:37 AM
Same problem here.

But I am using external browser (Chrome portable).
When I use putty - chrome works fine. When I connect through SSH.Net - it hangs with connect timeout.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Renci.SshNet;
namespace SafehouseIN
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        SshClient client;
        ForwardedPortDynamic port;
        private void button1_Click(object sender, EventArgs e)
        {
            client = new SshClient("serv","user","pass");

            client.ConnectionInfo.Timeout = TimeSpan.FromSeconds(5);
            client.Connect();

            if (client.IsConnected)
            {
                port = new ForwardedPortDynamic("localhost", 8080);
                client.AddForwardedPort(port);
                port.Start();
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            port.Stop();
            client.Disconnect();
        }
    }
}
2 Buttons - one for coinnecting, second for dosconnect.

Where I am wrong?