If you use the same code as some posts above, of course the tunnel is closed.
You are disposing the client object after port.Start(), thats what a using is block is for.
Just don't use using.
Maybe something like this:
You are disposing the client object after port.Start(), thats what a using is block is for.
Just don't use using.
Maybe something like this:
SshClient client;
public void Start()
{
client = new SshClient("vps97919.ovh.net", "tunnel", "123456")
client.KeepAliveInterval = new TimeSpan(0, 0, 30);
client.ConnectionInfo.Timeout = new TimeSpan(0, 0, 20);
client.Connect();
ForwardedPortDynamic port = new ForwardedPortDynamic("127.0.0.1", 1080);
client.AddForwardedPort(port);
port.Start();
}
public void Stop()
{
client.Disconnect();
}
Just an example, to show the problem with your code.