Sortix cross-volatile manual
This manual documents Sortix cross-volatile. You can instead view this document in the latest official manual.
CURLOPT_CONNECT_TO(3) | Library Functions Manual | CURLOPT_CONNECT_TO(3) |
NAME
CURLOPT_CONNECT_TO - connect to another host and port insteadSYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_CONNECT_TO,
struct curl_slist *connect_to);
DESCRIPTION
Pass a pointer to a linked list of strings with "connect to" information to use for establishing network connections with this handle. The linked list should be a fully valid list of struct curl_slist structs properly filled in. Use curl_slist_append(3) to create the list and curl_slist_free_all(3) to clean up an entire list.DEFAULT
NULLPROTOCOLS
This functionality affects all supported protocolsEXAMPLE
int main(void)
{
CURL *curl;
struct curl_slist *connect_to = NULL;
connect_to = curl_slist_append(NULL, "example.com::server1.example.com:");
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CONNECT_TO, connect_to);
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
curl_slist_free_all(connect_to);
}
AVAILABILITY
Added in curl 7.49.0RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.SEE ALSO
CURLOPT_FOLLOWLOCATION(3), CURLOPT_HTTPPROXYTUNNEL(3), CURLOPT_RESOLVE(3), CURLOPT_URL(3)2024-12-28 | libcurl |