diff options
Diffstat (limited to '')
-rw-r--r-- | src/aclk/aclk_proxy.c (renamed from aclk/aclk_proxy.c) | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/aclk/aclk_proxy.c b/src/aclk/aclk_proxy.c index 4af46208f..8d0e2d657 100644 --- a/aclk/aclk_proxy.c +++ b/src/aclk/aclk_proxy.c @@ -15,20 +15,6 @@ struct { { .type = PROXY_TYPE_UNKNOWN, .url_str = NULL }, }; -const char *aclk_proxy_type_to_s(ACLK_PROXY_TYPE *type) -{ - switch (*type) { - case PROXY_DISABLED: - return "disabled"; - case PROXY_TYPE_HTTP: - return "HTTP"; - case PROXY_TYPE_SOCKS5: - return "SOCKS"; - default: - return "Unknown"; - } -} - static inline ACLK_PROXY_TYPE aclk_find_proxy(const char *string) { int i = 0; @@ -127,7 +113,12 @@ static inline int check_http_enviroment(const char **proxy) const char *aclk_lws_wss_get_proxy_setting(ACLK_PROXY_TYPE *type) { - const char *proxy = config_get(CONFIG_SECTION_CLOUD, ACLK_PROXY_CONFIG_VAR, ACLK_PROXY_ENV); + const char *proxy = appconfig_get(&cloud_config, CONFIG_SECTION_GLOBAL, ACLK_PROXY_CONFIG_VAR, ACLK_PROXY_ENV); + + // backward compatibility: "proxy" was in "netdata.conf" + if (config_exists(CONFIG_SECTION_CLOUD, ACLK_PROXY_CONFIG_VAR)) + proxy = config_get(CONFIG_SECTION_CLOUD, ACLK_PROXY_CONFIG_VAR, ACLK_PROXY_ENV); + *type = PROXY_DISABLED; if (strcmp(proxy, "none") == 0) |