CURLOPT_RTSP_TRANSPORT(3)
π CURLOPT_RTSP_TRANSPORT(3) β the RTSP Transport: header glow-up
okay so bestie, welcome to the CURLOPT_RTSP_TRANSPORT(3) page from the Library Functions Manual β yes we're in libcurl land and this one is lowkey iconic if you're doing RTSP stuff π
β¨ SYNOPSIS β¨
like, here's the whole vibe in code:
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RTSP_TRANSPORT,
char *transport);
πΈ DESCRIPTION πΈ
so you pass a char pointer and it literally tells libcurl what to send as the Transport: header for this RTSP session π¦
it's mainly a convenience method β the whole point is to avoid needing to set a custom Transport: header for every single SETUP request. imagine doing that manually every time, no thank you π
β οΈ important bestie: the application must set a Transport: header before issuing a SETUP request. that's not optional, periodt.
and the slay part? the application does not have to keep the string around after setting this option. set it and forget it, main character energy π
π§ DEFAULT π§
NULL
π PROTOCOLS π
this functionality affects rtsp only. rtsp girlies only, iykyk π
β EXAMPLE β
here's how it's giving in practice:
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode result;
curl_easy_setopt(curl, CURLOPT_URL, "rtsp://example.com/");
curl_easy_setopt(curl, CURLOPT_RTSP_REQUEST, CURL_RTSPREQ_SETUP);
curl_easy_setopt(curl, CURLOPT_RTSP_TRANSPORT,
"RTP/AVP;unicast;client_port=4588-4589");
result = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
π HISTORY π
fun little lore drop: CURL_RTSPREQ_* enums became long types in 8.13.0. before that version, a long cast was necessary when passed to curl_easy_setopt(3). the more you know π
π«Ά AVAILABILITY π«Ά
added in curl 7.20.0 β vintage but cute β¨
π₯ 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 β go check
libcurl-errors(3)bestie π
π SEE ALSO π
and that's the whole page, no cap π this libcurl page is dated 2026-10-12 and comes to you from the libcurl fam β talk soon bestie, mwah ππ
π¦ where this page comes from
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- fedora 44: libcurl-devel 8.18.0-14.fc44 Β· curl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms