cURL / Mailing Lists / curl-library / Single Mail

curl-library

Setting proxy type using CURLOPT_PROXY?

From: Tillmann Steinbrecher <tsteinbr_at_igd.fraunhofer.de>
Date: Wed, 23 Aug 2006 14:38:12 +0200

Hi,

the documentation is a bit unclear about setting the proxy
protocol using CURLOPT_PROXY. First, it states:
"The proxy string may be prefixed with [protocol]:// since any such
prefix will be ignored", which is clear, but later, it says:
"Starting with 7.14.1, the proxy host string can be specified the exact
same way as the proxy environment variables, include protocol prefix"

I'm not sure what to make of it. Can I set the proxy protocol this way,
or can I not?

For convenience, I want to specify the entire proxy configuration in one
string (e.g. read from config file). Does this work:
curl_easy_setopt(curl, CURLOPT_PROXY,
"socks5://user:pass_at_gatekeeper.mycompany.net");

Or do I have to check manually if the string starts with "socks5" or
whatever, and then use CURLOPT_PROXYTYPE? Even if I have to do so, is it
safe to assume that - even in future versions - libcurl will not be
confused if the protocol is a string it doesn't know (e.g. "socks5")?

bye,
Tillmann
Received on 2006-08-23