This project is read-only.

SSH.Net log network data throw proxy

Aug 19, 2015 at 3:35 AM
Here is my code wich is use for login into a ssh server and foward port success
SshClient client;
ForwardedPortDynamic port;

public void Start(string server, string user, string password, int serverport=22)
{
        client = new SshClient(server, user, password);
        client.KeepAliveInterval = new TimeSpan(0, 0, 5);
        client.ConnectionInfo.Timeout = new TimeSpan(0, 0, 20);
        client.Connect();

        if (client.IsConnected)
        {
            try
            {
                port = new ForwardedPortDynamic("127.0.0.1", 1080);
                client.AddForwardedPort(port);
                port.Start();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString());
            }
        }

}

public void Stop()
{
    port.Stop();
    port.Dispose();
    client.Disconnect();
    client.Dispose();
}
On my Firefox browser I have added "127.0.0.1", 1080 into proxy setting and I can access website under this proxy, as a result, I want to write every network data going throw this proxy when I using proxy to a textbox but I don't know how to get log connection data. Is it like this port.ConnectionLog?

And the data I will received look like
Firefox.exe connecting to http://google.com..
Firefox.exe packet received first bye 22136...
....
Thanks in advanced
Aug 19, 2015 at 10:01 AM
Please help :(