Skip to content

Add support for Zlib compression (.NET 6.0 onward only) - #1326

Merged
Rob-Hague merged 27 commits into
sshnet:developfrom
scott-xu:zlib
Apr 17, 2024
Merged

Add support for Zlib compression (.NET 6.0 onward only)#1326
Rob-Hague merged 27 commits into
sshnet:developfrom
scott-xu:zlib

Conversation

@scott-xu

@scott-xuscott-xu commented Feb 17, 2024

Copy link
Copy Markdown
Collaborator

This PR adds support for zlib@openssh.com described in https://www.openssh.com/txt/draft-miller-secsh-compression-delayed-00.txt

Resolves#1130
Resolves#559
Resolves#336
Resolves#119

Notes:

  1. This PR only adds compression support for .NET 6.0+.

  2. "none" is the first and preferred compression method which means no compression by default, just like ssh_config:

    Compression
    Specifies whether to use compression. The argument must
    be yes or no (the default).

    The description of ssh -C option explains the reason:

    Compression is desirable on
    modem lines and other slow connections, but will only
    slow down things on fast networks.

  3. zlib (pre-auth) is not supported in OpenSSH server (sshd) but is listed in OpenSSH client (ssh).
    Since it is not easy to do integration-test for zlib (pre-auth), this PR does not add zlib (pre-auth).

Comment threadREADME.md
Comment threadsrc/Renci.SshNet/Compression/ZlibStream.cs Outdated
Comment threadtest/Renci.SshNet.IntegrationTests/CompressionTests.cs
@scott-xu
scott-xu marked this pull request as draft March 17, 2024 02:46
@scott-xu

scott-xu commented Mar 21, 2024

Copy link
Copy Markdown
CollaboratorAuthor

With this PR, SSH.NET targeted to frameworks below .NET 6.0 can easily use 3rd party library to do the compression. For example: https://github.com/scott-xu/SSH.NET.Ionic.Zlib/blob/main/src/SshNet.IonicZlib/ZLib.cs

@scott-xu
scott-xu marked this pull request as ready for review March 21, 2024 13:56
@scott-xu
scott-xu requested a review from Rob-HagueMarch 23, 2024 09:01
@scott-xu
scott-xu marked this pull request as draft March 23, 2024 10:10
This was referenced Aug 12, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compression support Compression with port forwarding - client drops connection Enable compression? Enable ZLib compression with Ionic

3 participants

@scott-xu@Rob-Hague@WojciechNagorski