Here is my code wich is use for login into a ssh server and foward port success
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
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(); }
And the data I will received look like
Firefox.exe connecting to http://google.com..Thanks in advanced
Firefox.exe packet received first bye 22136...
....