コード例 #1
0
ファイル: proxy_config.cpp プロジェクト: toisoftware/TideSDK
SharedProxy GetProxyForURL(string& url)
{
    static Logger* logger = GetLogger();
    URI uri(url);

    // Don't try to detect proxy settings for URLs we know are local
    std::string scheme(uri.getScheme());
    if (scheme == "app" || scheme == "ti" || scheme == "file")
        return 0;

    if (scheme == "http" && !httpProxyOverride.isNull())
        return httpProxyOverride;

    if (scheme == "https" && !httpsProxyOverride.isNull())
        return httpsProxyOverride;

    SharedProxy environmentProxy(GetProxyFromEnvironment(scheme));
    if (!environmentProxy.isNull())
    {
        logger->Debug("Found proxy (%s) in environment",
                      environmentProxy->ToString().c_str());
        return environmentProxy;
    }

    logger->Debug("Looking up proxy information for: %s", url.c_str());
    SharedProxy proxy(ProxyConfig::GetProxyForURLImpl(uri));

    if (proxy.isNull())
        logger->Debug("Using direct connection.");
    else
        logger->Debug("Using proxy: %s", proxy->ToString().c_str());

    return proxy;
}
コード例 #2
0
ファイル: proxy_config.cpp プロジェクト: jonnymind/kroll
		SharedProxy GetProxyForURL(string& url)
		{
			URI uri(url);

			// Don't try to detect proxy settings for URLs we know are local
			std::string scheme(uri.getScheme());
			if (scheme == "app" || scheme == "ti" || scheme == "file")
				return 0;

			if (scheme == "http" && !httpProxyOverride.isNull())
				return httpProxyOverride;

			if (scheme == "https" && !httpsProxyOverride.isNull())
				return httpsProxyOverride;

			return ProxyConfig::GetProxyForURLImpl(uri);
		}
コード例 #3
0
ファイル: Network.cpp プロジェクト: finglish/titanium_desktop
void Network::_GetHTTPSProxy(const ValueList& args, KValueRef result)
{
    SharedProxy proxy = ProxyConfig::GetHTTPSProxyOverride();

    if (proxy.isNull())
        result->SetNull();
    else
        result->SetString(proxy->ToString().c_str());
}