Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: SSH.Net log network data throw proxy

$
0
0
Here is my code wich is use for login into a ssh server and foward port success
SshClient client;
ForwardedPortDynamic port;

publicvoid 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());
            }
        }

}

publicvoid 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

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>