We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CURLINFO_PRIMARY_IP
CURLINFO_PRIMARY_PORT
CURLINFO_LOCAL_IP
CURLINFO_LOCAL_PORT
const char *url = "https://cloudflare-quic.com"; CURL *http_handle = curl_easy_init(); curl_easy_setopt(http_handle, CURLOPT_URL, url); curl_easy_setopt(http_handle, CURLOPT_FOLLOWLOCATION, 1L); curl_easy_setopt(http_handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_3); for(int i=0; i<2; i++) { CURLcode res = curl_easy_perform(http_handle); if(res == CURLE_OK) { char *primary_ip = NULL; curl_easy_getinfo(http_handle, CURLINFO_PRIMARY_IP, &primary_ip); long primary_port = 0L; curl_easy_getinfo(http_handle, CURLINFO_PRIMARY_PORT, &primary_port); char *local_ip = NULL; curl_easy_getinfo(http_handle, CURLINFO_LOCAL_IP, &local_ip); long local_port = 0L; curl_easy_getinfo(http_handle, CURLINFO_LOCAL_PORT, &local_port); long num_connects = 0L; curl_easy_getinfo(http_handle, CURLINFO_NUM_CONNECTS, &num_connects); printf("primary %s:%d, local %s:%d, connects: %d\n", primary_ip, primary_port, local_ip, local_port, num_connects); } else printf("curl error %d\n", res); }
primary :443, local :-1, connects: 1 primary :443, local :-1, connects: 0
libcurl/7.83.0 BoringSSL zlib/1.2.7 brotli/1.0.9 nghttp2/1.41.0 quiche/0.12.0
Linux mylinux 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered:
submit my solution in #9287
Sorry, something went wrong.
6ba3047
Successfully merging a pull request may close this issue.
I did this
CURLINFO_PRIMARY_IP
/CURLINFO_PRIMARY_PORT
/CURLINFO_LOCAL_IP
/CURLINFO_LOCAL_PORT
I expected the following
curl/libcurl version
libcurl/7.83.0 BoringSSL zlib/1.2.7 brotli/1.0.9 nghttp2/1.41.0 quiche/0.12.0
operating system
Linux mylinux 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
The text was updated successfully, but these errors were encountered: