简体   繁体   中英

Using libcurl to access proxy

I want to access a proxy using libcurl in my C code. I read that with this command I can configure libcurl to access the proxy:

curl_easy_setopt(handle, CURLOPT_PROXY, "127.0.0.1:96666");

But is that all I have to do? Do I need to open a socket?

Any tip will be very helpful,

Thanks.

Yes, that's all you need - assuming it is a HTTP proxy and you fix the port number, because 96666 is not a valid port! :-)

See the CURLOPT_PROXY man page for more details.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM