Sortix nightly manual
This manual documents Sortix nightly, a development build that has not been officially released. You can instead view this document in the latest official manual.
CURLOPT_RESOLVE(3) | Library Functions Manual | CURLOPT_RESOLVE(3) |
NAME
CURLOPT_RESOLVE - provide custom hostname to IP address resolvesSYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RESOLVE,
struct curl_slist *hosts);
DESCRIPTION
Pass a pointer to a linked list of strings with hostname resolve information to use for requests 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.[+]HOST:PORT:ADDRESS[,ADDRESS]
-HOST:PORT
DEFAULT
NULLPROTOCOLS
This functionality affects all supported protocolsEXAMPLE
int main(void)
{
CURL *curl;
struct curl_slist *host = NULL;
host = curl_slist_append(NULL, "example.com:443:127.0.0.1");
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_RESOLVE, host);
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com");
curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
curl_slist_free_all(host);
}
HISTORY
Added in 7.21.3. Removal support added in 7.42.0.AVAILABILITY
Added in curl 7.21.3RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.SEE ALSO
CURLOPT_CONNECT_TO(3), CURLOPT_DNS_CACHE_TIMEOUT(3), CURLOPT_IPRESOLVE(3)2024-12-21 | libcurl |