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

Side by Side Diff: net/proxy/proxy_server.cc

Issue 113811: Adding socks4 support for chromium. tested for windows and linux.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: final patch Created 11 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/proxy/proxy_config_unittest.cc ('k') | net/proxy/proxy_server_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "net/proxy/proxy_server.h" 5 #include "net/proxy/proxy_server.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/string_tokenizer.h" 9 #include "base/string_tokenizer.h"
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 29 matching lines...) Expand all
40 40
41 // Parse the proxy scheme from a URL-like representation, to a 41 // Parse the proxy scheme from a URL-like representation, to a
42 // ProxyServer::Scheme. This corresponds with the values used in 42 // ProxyServer::Scheme. This corresponds with the values used in
43 // ProxyServer::ToURI(). If no type could be matched, returns SCHEME_INVALID. 43 // ProxyServer::ToURI(). If no type could be matched, returns SCHEME_INVALID.
44 ProxyServer::Scheme GetSchemeFromURI(std::string::const_iterator begin, 44 ProxyServer::Scheme GetSchemeFromURI(std::string::const_iterator begin,
45 std::string::const_iterator end) { 45 std::string::const_iterator end) {
46 if (LowerCaseEqualsASCII(begin, end, "http")) 46 if (LowerCaseEqualsASCII(begin, end, "http"))
47 return ProxyServer::SCHEME_HTTP; 47 return ProxyServer::SCHEME_HTTP;
48 if (LowerCaseEqualsASCII(begin, end, "socks4")) 48 if (LowerCaseEqualsASCII(begin, end, "socks4"))
49 return ProxyServer::SCHEME_SOCKS4; 49 return ProxyServer::SCHEME_SOCKS4;
50 if (LowerCaseEqualsASCII(begin, end, "socks"))
51 return ProxyServer::SCHEME_SOCKS4;
50 if (LowerCaseEqualsASCII(begin, end, "socks5")) 52 if (LowerCaseEqualsASCII(begin, end, "socks5"))
51 return ProxyServer::SCHEME_SOCKS5; 53 return ProxyServer::SCHEME_SOCKS5;
52 if (LowerCaseEqualsASCII(begin, end, "direct")) 54 if (LowerCaseEqualsASCII(begin, end, "direct"))
53 return ProxyServer::SCHEME_DIRECT; 55 return ProxyServer::SCHEME_DIRECT;
54 return ProxyServer::SCHEME_INVALID; 56 return ProxyServer::SCHEME_INVALID;
55 } 57 }
56 58
57 } // namespace 59 } // namespace
58 60
59 std::string ProxyServer::HostNoBrackets() const { 61 std::string ProxyServer::HostNoBrackets() const {
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 } 213 }
212 214
213 // Choose a default port number if none was given. 215 // Choose a default port number if none was given.
214 if (port == -1) 216 if (port == -1)
215 port = GetDefaultPortForScheme(scheme); 217 port = GetDefaultPortForScheme(scheme);
216 218
217 return ProxyServer(scheme, host, port); 219 return ProxyServer(scheme, host, port);
218 } 220 }
219 221
220 } // namespace net 222 } // namespace net
OLDNEW
« no previous file with comments | « net/proxy/proxy_config_unittest.cc ('k') | net/proxy/proxy_server_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698