[sr-dev] [kamailio] module http_client - support setting default http proxy (#541)

filiplx notifications at github.com
Thu Mar 24 15:46:39 CET 2016


Did not manage to get default proxy to work.

I used the same config as I used with my home-brewed version of http_client.

The API calls work, it's just the proxy config that isn't applied.


#
# Config
#

#!define API_SERVER_A "apiA=>http://name:pass@api01.host.com"
#!define API_SERVER_B "apiB=>http://name:pass@api02.host.com"

loadmodule "http_client.so"
modparam("http_client", "httpcon", API_SERVER_A)
modparam("http_client", "httpcon", API_SERVER_B)
modparam("http_client", "httpproxy", "proxyhost")
modparam("http_client", "httpproxyport", 8181)


/* in functions.c */

    if (params->http_proxy  != NULL) {
    LM_INFO("****** ##### CURL proxy [%s] \n", params->http_proxy);
	res |= curl_easy_setopt(curl, CURLOPT_PROXY, params->http_proxy);
    } else {
    LM_INFO("****** ##### CURL proxy NOT SET \n");
    }

    if (params->http_proxy_port > 0) {
    LM_INFO("****** ##### CURL proxy port [%d] \n", params->http_proxy_port);
	res |= curl_easy_setopt(curl, CURLOPT_PROXYPORT, params->http_proxy_port);
    } else {
    LM_INFO("****** ##### CURL proxy port NOT SET \n");
    }


#
# Log
#

Mar 24 15:35:35 32048a54378d /usr/sbin/kamailio[8465]: INFO: http_client [functions.c:189]: curL_query_url(): ****** ##### CURL proxy NOT SET 
Mar 24 15:35:35 32048a54378d /usr/sbin/kamailio[8465]: INFO: http_client [functions.c:196]: curL_query_url(): ****** ##### CURL proxy port NOT SET 

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/541#issuecomment-200868545
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-dev/attachments/20160324/133484ee/attachment.html>


More information about the sr-dev mailing list