Archived Forum Post

Index of archived forum posts

Question:

SSH Tunnel Port Forward With Browser Auto Disconnect

Feb 01 '16 at 10:58

-Start Port Forward:

tunnel.BeginAccepting(1080);

-Run Browser use proxy: 127.0.0.1:1080.

-After page load tunnel port forward stop. How to continue port forward until i stop it?


Answer

What programming language, operating system, etc. (32-bit/64-bit, .NET Framework version, Visual Studio version etc..) do you use? There is a fix that may solve the problem.


Answer

My programming language is C# 32bit, NetFrame v4.0


Answer

Please try this new build:

32-bit Download: http://www.chilkatsoft.com/download/preRelease/ChilkatDotNet4-9.5.0-win32.zip

64-bit Download: http://www.chilkatsoft.com/download/preRelease/ChilkatDotNet4-9.5.0-x64.zip


Answer

Can you show me how to use BeginAcceptingAsync. It's always stop after run. My code

        Chilkat.Task task = tunnel.BeginAcceptingAsync(1080);
        success = task.Run();

Answer

BeginAccepting starts a background thread to begin listening and servicing incoming connections. A process is composed of threads. If your program starts the background "accept" thread, and then exits, this means the entire process is exiting -- including all threads.

Your program would need to keep running, even if in a simple infinite loop:

while (true)
{
    Sleep(100);
    }
    


Answer

My Thread not stop. After BeginAcceptingAsync

While(!task.Finished) { Sleep(100); }


Answer

I'm not finding any problem. Here's my test code:

            Chilkat.SshTunnel tunnel = new Chilkat.SshTunnel();

        Chilkat.Task task = tunnel.BeginAcceptingAsync(1080);
        if (task == null)
            {
            textBox2.Text = tunnel.LastErrorText;
            return;
            }

        bool success = task.Run();
        if (success != true)
            {
            textBox2.Text = task.LastErrorText;

            return;
            }

        while (task.Finished != true)
            {
            task.SleepMs(100);
            }

        textBox2.Text = "Task Finished!";

Answer

Still not work :(. Chilkat Dll version is 9.5.0.56 ?

Check this: link text