34int main(
int argc,
char* argv[]) {
39 for (
int i = 1; i < argc; i++) {
40 if (strcmp(argv[i],
"-V") == 0 && i + 1 < argc) {
41 if (strcmp(argv[i + 1],
"LOG_DEBUG") == 0)
43 else if (strcmp(argv[i + 1],
"LOG_ERR") == 0)
45 else if (strcmp(argv[i + 1],
"LOG_NOTICE") == 0)
61 if (strcmp(cfg->
scheme,
"http") != 0) errors++;
62 if (strcmp(cfg->
host,
"proxy.corp") != 0) errors++;
63 if (cfg->
port != 3128) errors++;
80 if (strcmp(cfg->
scheme,
"socks5") != 0) errors++;
81 if (strcmp(cfg->
host,
"proxy.corp") != 0) errors++;
82 if (cfg->
port != 1080) errors++;
99 if (strcmp(cfg->
scheme,
"https") != 0) errors++;
100 if (strcmp(cfg->
host,
"secure-proxy.corp") != 0) errors++;
101 if (cfg->
port != 8443) errors++;
117 if (strcmp(cfg->
scheme,
"https") != 0) errors++;
118 if (cfg->
port != 3128) errors++;
139 errors == 0 ?
"PASS" :
"FAIL", errors, errors == 1 ?
"" :
"s");
140 return errors > 0 ? 1 : 0;
#define n_log(__LEVEL__,...)
Logging function wrapper to get line and func.
#define LOG_DEBUG
debug-level messages
#define LOG_ERR
error conditions
void set_log_level(const int log_level)
Set the global log level value ( static int LOG_LEVEL )
#define LOG_NOTICE
normal but significant condition
#define LOG_INFO
informational
char * host
proxy hostname
char * password
NULL if no auth.
char * scheme
"http", "https", or "socks5"
char * username
NULL if no auth.
N_PROXY_CFG * n_proxy_cfg_parse(const char *url)
Parse a proxy URL string into an N_PROXY_CFG struct.
void n_proxy_cfg_free(N_PROXY_CFG **cfg)
Free an N_PROXY_CFG created by n_proxy_cfg_parse().
Parsed proxy URL components.
Common headers and low-level functions & define.