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_INTERFACE(3) | libcurl | 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 * 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 host name.DEFAULT
NULL, use whatever the TCP stack finds suitablePROTOCOLS
AllEXAMPLE
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);
}
}
AVAILABILITY
The "if!" and "host!" syntax was added in 7.24.0.RETURN VALUE
Returns CURLE_OK on success or CURLE_OUT_OF_MEMORY if there was insufficient heap space.SEE ALSO
CURLOPT_SOCKOPTFUNCTION(3), CURLOPT_TCP_NODELAY(3)December 4, 2023 | ibcurl 8.5.0 |