Home | History | Annotate | Download | only in base

Lines Matching refs:proxy

98   LPWSTR lpszProxy;         // proxy server list
99 LPWSTR lpszProxyBypass; // proxy bypass list
286 bool ParseProxy(const std::string& saddress, ProxyInfo* proxy) {
311 LOG(LS_WARNING) << "Proxy address too long [" << start << "]";
321 LOG(LS_WARNING) << "Proxy address without port [" << buffer << "]";
329 LOG(LS_WARNING) << "Proxy address with invalid port [" << buffer << "]";
341 LOG(LS_WARNING) << "Proxy address with unknown protocol ["
350 if (Better(ptype, proxy->type)) {
351 proxy->type = ptype;
352 proxy->address.SetIP(host);
353 proxy->address.SetPort(port);
357 return proxy->type != PROXY_NONE;
544 bool GetFirefoxProxySettings(const char* url, ProxyInfo* proxy) {
551 if (ReadFirefoxPrefs(path, "network.proxy.", &settings)) {
553 proxy->bypass_list =
556 // User has manually specified a proxy, try to figure out what
558 if (ProxyListMatch(purl, proxy->bypass_list.c_str(), ',')) {
559 // Our url is in the list of url's to bypass proxy.
561 proxy->type = PROXY_UNKNOWN;
562 proxy->address.SetIP(settings.Get("http"));
563 proxy->address.SetPort(atoi(settings.Get("http_port").c_str()));
565 proxy->type = PROXY_SOCKS5;
566 proxy->address.SetIP(settings.Get("socks"));
567 proxy->address.SetPort(atoi(settings.Get("socks_port").c_str()));
569 proxy->type = PROXY_HTTPS;
570 proxy->address.SetIP(settings.Get("ssl"));
571 proxy->address.SetPort(atoi(settings.Get("ssl_port").c_str()));
573 proxy->type = PROXY_HTTPS;
574 proxy->address.SetIP(settings.Get("http"));
575 proxy
578 // Browser is configured to get proxy settings from a given url.
579 proxy->autoconfig_url = settings.Get("autoconfig_url").c_str();
581 // Browser is configured to auto detect proxy config.
582 proxy->autodetect = true;
584 // No proxy set.
592 // Explorer proxy settings.
654 bool GetWinHttpProxySettings(const char* url, ProxyInfo* proxy) {
669 // We were read proxy config successfully.
672 proxy->autodetect = true;
675 proxy->autoconfig_url = ToUtf8(iecfg.lpszAutoConfigUrl);
679 proxy->bypass_list = ToUtf8(iecfg.lpszProxyBypass);
683 if (!ProxyListMatch(purl, proxy->bypass_list, ';')) {
684 ParseProxy(ToUtf8(iecfg.lpszProxy), proxy);
693 // Uses the WinHTTP API to auto detect proxy for the given url. Firefox and IE
694 // have slightly different option dialogs for proxy settings. In Firefox,
695 // either a location of a proxy configuration file can be specified or auto
702 // whether we found a proxy or not. Returns false on error.
704 ProxyInfo* proxy) {
730 if (proxy->autodetect) {
731 // Use DHCP and DNS to try to find any proxy to use.
742 if (!result && !proxy->autoconfig_url.empty()) {
743 // We have the location of a proxy config file. Download it and
744 // execute it to find proxy settings for our url.
750 std::wstring autoconfig_url16((ToUtf16)(proxy->autoconfig_url));
759 // detection found a proxy on this network.
764 proxy->bypass_list = ToUtf8(info.lpszProxyBypass);
767 proxy->bypass_list.clear();
769 if (!ProxyListMatch(purl, proxy->bypass_list, ';')) {
770 // Found proxy for this URL. If parsing the address turns
772 success = ParseProxy(ToUtf8(info.lpszProxy), proxy);
777 // We could not find any proxy for this url.
778 LOG(LS_INFO) << "No proxy detected for " << url;
792 bool GetJsProxySettings(const char* url, ProxyInfo* proxy) {
801 char proxy[256], host[256];
802 memset(proxy, 0, sizeof(proxy));
803 char * ptr = proxy;
804 DWORD proxylen = sizeof(proxy);
809 LOG(INFO) << "Proxy: " << proxy;
819 bool GetWmProxySettings(const char* url, ProxyInfo* proxy) {
835 BSTR proxy = 0;
839 L"http", host, &bProxyEnabled, &proxy, &port, &context))) {
842 _bstr_t sproxy = proxy;
843 proxy->ptype = PT_HTTPS;
844 proxy->host = sproxy;
845 proxy->port = port;
848 SysFreeString(proxy);
866 bool GetIePerConnectionProxySettings(const char* url, ProxyInfo* proxy) {
889 ParseProxy(nonnull(options[1].Value.pszValue), proxy);
908 // Uses the InternetQueryOption function to retrieve proxy settings
911 bool GetIeLanProxySettings(const char* url, ProxyInfo* proxy) {
929 proxy);
937 bool GetIeProxySettings(const char* agent, const char* url, ProxyInfo* proxy) {
938 bool success = GetWinHttpProxySettings(url, proxy);
940 // TODO: Should always call this if no proxy were detected by
943 return GetIeLanProxySettings(url, proxy);
951 // proxy settings.
953 bool p_getProxyInfoForTypeFromDictWithKeys(ProxyInfo* proxy,
959 // whether or not we set up the proxy info.
966 // the data we need to construct the SocketAddress for the proxy.
989 // That's sufficient to set up the proxy info.
990 proxy->type = type;
991 proxy->address.SetIP(hostname);
992 proxy->address.SetPort(port);
1002 // Looks for proxy information in the given dictionary,
1004 // false otherwise. This is guaranteed to not change the values in proxy
1005 // unless a full-fledged proxy description was discovered in the dictionary.
1007 // Checks first for a SOCKS proxy, then for HTTPS, then HTTP.
1008 bool GetMacProxySettingsFromDictionary(ProxyInfo* proxy,
1014 // first we see if there's a SOCKS proxy in place.
1015 gotProxy = p_getProxyInfoForTypeFromDictWithKeys(proxy,
1023 // okay, no SOCKS proxy, let's look for https.
1024 gotProxy = p_getProxyInfoForTypeFromDictWithKeys(proxy,
1031 // Finally, try HTTP proxy. Note that flute doesn't
1035 proxy, PROXY_HTTPS, proxyDict, kSCPropNetProxiesHTTPEnable,
1044 bool p_putPasswordInProxyInfo(ProxyInfo* proxy) {
1059 switch (proxy->type) {
1067 LOG(LS_ERROR) << "asked for proxy password for unknown proxy type.";
1073 UInt32 port = proxy->address.port();
1078 std::string ip = proxy->address.ipaddr().ToString();
1084 LOG(LS_INFO) << "trying to get proxy username/password";
1128 // now put the username in the proxy.
1130 proxy->username.append(
1133 LOG(LS_INFO) << "username is " << proxy->username;
1161 bool GetMacProxySettings(ProxyInfo* proxy) {
1170 result = GetMacProxySettingsFromDictionary(proxy, proxyDict);
1173 result = p_putPasswordInProxyInfo(proxy);
1189 // iOS has only http proxy
1190 bool GetiOSProxySettings(ProxyInfo* proxy) {
1212 // the data we need to construct the SocketAddress for the proxy.
1218 // That's sufficient to set up the proxy info.
1219 // Finally, try HTTP proxy. Note that flute doesn't
1222 proxy->type = PROXY_HTTPS;
1224 proxy->address.SetIP(hostname);
1225 proxy->address.SetPort(port);
1239 ProxyInfo* proxy) {
1241 return WinHttpAutoDetectProxyForUrl(agent, url, proxy);
1243 LOG(LS_WARNING) << "Proxy auto-detection not implemented for this platform";
1249 ProxyInfo* proxy) {
1251 return GetIeProxySettings(agent, url, proxy);
1253 return GetMacProxySettings(proxy);
1255 return GetiOSProxySettings(proxy);
1258 return GetFirefoxProxySettings(url, proxy);
1263 ProxyInfo* proxy, bool long_operation) {
1268 result = GetFirefoxProxySettings(url, proxy);
1273 result = GetIeProxySettings(agent, url, proxy);
1278 result = GetFirefoxProxySettings(url, proxy);
1280 result = GetIeProxySettings(agent, url, proxy);
1285 result = GetSystemDefaultProxySettings(agent, url, proxy);
1291 if (result && (proxy->autodetect ||
1292 !proxy->autoconfig_url.empty())) {
1293 // Use WinHTTP to auto detect proxy for us.
1294 result = AutoDetectProxySettings(agent, url, proxy);
1297 // find any proxy, reset type.
1298 proxy->type = rtc::PROXY_NONE;