diff options
author | Alan Fitton <ajf@eth0.org.uk> | 2011-03-07 20:39:04 +0000 |
---|---|---|
committer | Alan Fitton <ajf@eth0.org.uk> | 2011-03-07 20:39:04 +0000 |
commit | 4073ac25ea4f0b38bef0ad09664e4e66e6fe7f00 (patch) | |
tree | 626f8923ef9ad83f2d47b6dd4f6b3994ca563afd /src/http.c | |
parent | ecbd6bbb7423bc9b6f329f937bf740b7dc87598d (diff) |
support proxy configuration using libproxy (optional). might add a getenv() fallback sometime.
Diffstat (limited to 'src/http.c')
-rw-r--r-- | src/http.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -76,9 +76,16 @@ static struct http_response *trg_http_perform_inner(trg_client * tc, curl_easy_setopt(handle, CURLOPT_HEADERFUNCTION, &header_callback); curl_easy_setopt(handle, CURLOPT_WRITEHEADER, (void *) tc); curl_easy_setopt(handle, CURLOPT_POSTFIELDS, req); + if (tc->ssl) curl_easy_setopt(handle, CURLOPT_SSL_VERIFYPEER, 0); + if (tc->proxy) { + curl_easy_setopt(handle, CURLOPT_PROXYTYPE, CURLPROXY_HTTP); + curl_easy_setopt(handle, CURLOPT_PROXY, tc->proxy); + } + + if (tc->session_id != NULL) { headers = curl_slist_append(headers, tc->session_id); curl_easy_setopt(handle, CURLOPT_HTTPHEADER, headers); |