Help with Compression.

May 8, 2014 at 3:32 AM
Im a bit of a noob at this. I have read the prior posts that suggest to include Ionic.Zlib and un-comment the necessary code. Im a bit confused as to what exactly to download, what exactly to un-comment and how exactly to include this in my current project. I currently have a small SSH client in c# which is working fine and connects to my remote server. I need a bit of help making this client use zlib compression. Any help would be much appreciated. Thanks.
May 9, 2014 at 11:52 PM
Ok so iv been searching and trying to figure out how to tunnel using zlib. So far iv downloaded and added Ionic.Zlib to my project and seen a few different pieces of code like this.
stream = new Ionic.Zlib.ZlibStream(stream, Ionic.Zlib.CompressionMode.Compress, Ionic.Zlib.CompressionLevel.Default);
and this.
this.CompressionAlgorithms = new Dictionary<string, Type>()
            {
                {"zlib", typeof(Zlib)},          
            };
As i stated in my last post i have a simple SSH client with a forwarded port, here is an example of what im using.
using (_Client = new SshClient(connectionInfo)) //SSH server/port/user/pass
                {


                    _Client.Connect();

                    if (_Client.IsConnected)
                    {
                       
                    }
                    else
                    {
                        //
                    }


                    _Port = new ForwardedPortLocal("127.0.0.1", _UOPort, "localhost", _UOPort); 
                    _Client.AddForwardedPort(_Port);


                    _Port.RequestReceived += delegate(object sender, PortForwardEventArgs e)
                    {
                        ConsoleWriteLine(e.OriginatorHost + ":" + e.OriginatorPort);
                    };

                    _Port.Start();

                    if (_Port.IsStarted)
                    {


                    }

                    while (true)
                    {
                    }
           }
So i connect my tcp client to localhost:2593 to go through the tunnel. How can i enable Zlib compression for my tcp client packets? I currently have a Bitvise SSH server with Zlib enabled to test it. Please much help appreciated this is driving me a bit loopy!