CURLOPT_SSH_COMPRESSION(3)

✨ CURLOPT_SSH_COMPRESSION ✨

okay bestie, so this is a page from the libcurl Library Functions Manual and honestly? it's a short one but it's lowkey iconic. sit down, hydrate, let's go πŸ’…

🌸 NAME 🌸

CURLOPT_SSH_COMPRESSION β€” enable SSH compression πŸŽ€

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <curl/curl.h>

CURLcode curl_easy_setopt(CURL *handle, CURLOPT_SSH_COMPRESSION, long enable);

πŸ’– DESCRIPTION πŸ’–

so you pass in a long as your parameter, and the vibe is: set it to 1L to enable, or 0L to disable. that's it. that's the whole thing 🫢

it turns on built-in SSH compression. but bestie, listen to me β€” this is a request, not an order. the server may or may not actually do it. you're basically sliding into the server's DMs like "hey could u compress πŸ₯Ί" and the server gets to decide. no cap, that's the dynamic. ✨

πŸŽ€ DEFAULT πŸŽ€

0, disabled

like, off. not on. the compression is not giving until you ask. πŸ’€

🌈 PROTOCOLS 🌈

this functionality affects scp and sftp β€” that's the whole guest list, iykyk πŸ”₯

🧚 EXAMPLE 🧚

int main(void)
{
  CURL *curl = curl_easy_init();
  if(curl) {
    curl_easy_setopt(curl, CURLOPT_URL, "sftp://example.com");

    /* enable built-in compression */
    curl_easy_setopt(curl, CURLOPT_SSH_COMPRESSION, 1L);

    /* Perform the request */
    curl_easy_perform(curl);
  }
}

look at her go. main character energy fr fr πŸ‘‘

⭐ AVAILABILITY ⭐

Added in curl 7.56.0 β€” so if you're on something older, this option is gonna ghost you πŸ™ˆ

πŸ’œ RETURN VALUE πŸ’œ

curl_easy_setopt(3) returns a CURLcode indicating success or error.

CURLE_OK (0) means everything was OK πŸ₯³ β€” non-zero means an error occurred, so go see libcurl-errors(3) and figure out what's wrong. 😭

🌸 SEE ALSO 🌸


and that's the tea, bestie πŸ“ this page is from libcurl, dated 2026-10-12, and it's literally called CURLOPT_SSH_COMPRESSION(3) β€” go compress something, ily, bye πŸ’–βœ¨πŸ’…

πŸ“¦ where this page comes from