Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Unified Diff: net/proxy/proxy_config.cc

Issue 678003002: Correct manual proxy selection for WebSockets. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: net/proxy/proxy_config.cc
diff --git a/net/proxy/proxy_config.cc b/net/proxy/proxy_config.cc
index 86c5284d837429b03e201b76b948c172f6ec1c40..94161a2e24fb7893749995d9f6a3b277df1e9f44 100644
--- a/net/proxy/proxy_config.cc
+++ b/net/proxy/proxy_config.cc
@@ -170,9 +170,21 @@ ProxyList* ProxyConfig::ProxyRules::MapUrlSchemeToProxyListNoFallback(
return &proxies_for_https;
if (scheme == "ftp")
return &proxies_for_ftp;
+ if (scheme == "ws" || scheme == "wss")
+ return GetProxyListForWebSocketScheme();
return NULL; // No mapping for this scheme.
}
+ProxyList* ProxyConfig::ProxyRules::GetProxyListForWebSocketScheme() {
+ if (!fallback_proxies.IsEmpty())
+ return &fallback_proxies;
+ if (!proxies_for_https.IsEmpty())
+ return &proxies_for_https;
+ if (!proxies_for_http.IsEmpty())
+ return &proxies_for_http;
+ return NULL;
+}
+
ProxyConfig::ProxyConfig()
: auto_detect_(false), pac_mandatory_(false),
source_(PROXY_CONFIG_SOURCE_UNKNOWN), id_(kInvalidConfigID) {

Powered by Google App Engine
This is Rietveld 408576698