Sortix cross-volatile manual
This manual documents Sortix cross-volatile. You can instead view this document in the latest official manual.
CURLOPT_INTERFACE(3) | Library Functions Manual | CURLOPT_INTERFACE(3) |
NAME
CURLOPT_INTERFACE - source interface for outgoing trafficSYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_INTERFACE, char *interface);
DESCRIPTION
Pass a char pointer as parameter. This sets the interface name to use as outgoing network interface. The name can be an interface name, an IP address, or a hostname. If you prefer one of these, you can use the following special prefixes:DEFAULT
NULL, use whatever the TCP stack finds suitablePROTOCOLS
This functionality affects all supported protocolsEXAMPLE
int main(void)
{
CURL *curl = curl_easy_init();
if(curl) {
CURLcode res;
curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/foo.bin");
curl_easy_setopt(curl, CURLOPT_INTERFACE, "eth0");
res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
}
}
HISTORY
The if! and host! syntax was added in 7.24.0.AVAILABILITY
Added in curl 7.3RETURN VALUE
Returns CURLE_OK on success or CURLE_OUT_OF_MEMORY if there was insufficient heap space.SEE ALSO
CURLOPT_LOCALPORT(3), CURLOPT_SOCKOPTFUNCTION(3), CURLOPT_TCP_NODELAY(3)2024-12-28 | libcurl |