preproxy: renamed what was added as SOCKS_PROXY

CURLOPT_SOCKS_PROXY -> CURLOPT_PRE_PROXY

Added the corresponding --preroxy command line option. Sets a SOCKS
proxy to connect to _before_ connecting to a HTTP(S) proxy.
This commit is contained in:
Daniel Stenberg 2016-12-16 16:02:08 +01:00
parent 642398c651
commit 845522cadb
12 changed files with 80 additions and 29 deletions

View file

@ -290,6 +290,7 @@ static const struct LongShort aliases[]= {
{"V", "version", FALSE},
{"w", "write-out", TRUE},
{"x", "proxy", TRUE},
{"xa", "preproxy", TRUE},
{"X", "request", TRUE},
{"Y", "speed-limit", TRUE},
{"y", "speed-time", TRUE},
@ -1920,9 +1921,16 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
GetStr(&config->writeout, nextarg);
break;
case 'x':
/* proxy */
GetStr(&config->proxy, nextarg);
config->proxyver = CURLPROXY_HTTP;
switch(subletter) {
case 'a': /* --preproxy */
GetStr(&config->preproxy, nextarg);
break;
default:
/* --proxy */
GetStr(&config->proxy, nextarg);
config->proxyver = CURLPROXY_HTTP;
break;
}
break;
case 'X':
/* set custom request */