OLD | NEW |
| (Empty) |
1 <!DOCTYPE html><!-- This page is a placeholder for generated extensions api doc.
Note: | |
2 1) The <head> information in this page is significant, should be uniform | |
3 across api docs and should be edited only with knowledge of the | |
4 templating mechanism. | |
5 3) All <body>.innerHTML is genereated as an rendering step. If viewed in a | |
6 browser, it will be re-generated from the template, json schema and | |
7 authored overview content. | |
8 4) The <body>.innerHTML is also generated by an offline step so that this | |
9 page may easily be indexed by search engines. | |
10 --><html xmlns="http://www.w3.org/1999/xhtml"><head> | |
11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
12 <link href="css/ApiRefStyles.css" rel="stylesheet" type="text/css"> | |
13 <link href="css/print.css" rel="stylesheet" type="text/css" media="print"> | |
14 <script type="text/javascript" src="../../../third_party/jstemplate/jstempla
te_compiled.js"> | |
15 </script> | |
16 <script type="text/javascript" src="../../../../third_party/json_minify/mini
fy-sans-regexp.js"> | |
17 </script> | |
18 <script type="text/javascript" src="js/api_page_generator.js"></script> | |
19 <script type="text/javascript" src="js/bootstrap.js"></script> | |
20 <script type="text/javascript" src="js/sidebar.js"></script> | |
21 <meta name="description" content="Documentation for the chrome.proxy module, w
hich is part of the Google Chrome extension APIs."><title>Proxy Settings - Goog
le Chrome Extensions - Google Code</title></head> | |
22 <body> <div id="devModeWarning" class="displayModeWarning"> | |
23 You are viewing extension docs in chrome via the 'file:' scheme: are you exp
ecting to see local changes when you refresh? You'll need run chrome with --allo
w-file-access-from-files. | |
24 </div> | |
25 <div id="branchWarning" class="displayModeWarning"> | |
26 <span>WARNING: This is the <span id="branchName">BETA</span> documentation. | |
27 It may not work with the stable release of Chrome.</span> | |
28 <select id="branchChooser"> | |
29 <option>Choose a different version... | |
30 </option><option value="">Stable | |
31 </option><option value="beta">Beta | |
32 </option><option value="dev">Dev | |
33 </option><option value="trunk">Trunk | |
34 </option></select> | |
35 </div> | |
36 <div id="unofficialWarning" class="displayModeWarning"> | |
37 <span>WARNING: This is unofficial documentation. It may not work with the | |
38 current release of Chrome.</span> | |
39 <button id="goToOfficialDocs">Go to the official docs</button> | |
40 </div> | |
41 <div id="gc-container" class="labs"> | |
42 <!-- SUBTEMPLATES: DO NOT MOVE FROM THIS LOCATION --> | |
43 <!-- In particular, sub-templates that recurse, must be used by allowing | |
44 jstemplate to make a copy of the template in this section which | |
45 are not operated on by way of the jsskip="true" --> | |
46 <!-- /SUBTEMPLATES --> | |
47 <a id="top"></a> | |
48 <div id="skipto"> | |
49 <a href="#gc-pagecontent">Skip to page content</a> | |
50 <a href="#gc-toc">Skip to main navigation</a> | |
51 </div> | |
52 <!-- API HEADER --> | |
53 <table id="header" width="100%" cellspacing="0" border="0"> | |
54 <tbody><tr> | |
55 <td valign="middle"><a href="http://code.google.com/"><img src="images/c
ode_labs_logo.gif" height="43" width="161" alt="Google Code Labs" style="border:
0; margin:0;"></a></td> | |
56 <td valign="middle" width="100%" style="padding-left:0.6em;"> | |
57 <form action="http://www.google.com/cse" id="cse" style="margin-top:0.
5em"> | |
58 <div id="gsc-search-box"> | |
59 <input type="hidden" name="cx" value="002967670403910741006:61_cvz
fqtno"> | |
60 <input type="hidden" name="ie" value="UTF-8"> | |
61 <input type="text" name="q" value="" size="55"> | |
62 <input class="gsc-search-button" type="submit" name="sa" value="Se
arch"> | |
63 <br> | |
64 <span class="greytext">e.g. "page action" or "tabs"</span> | |
65 </div> | |
66 </form> | |
67 <script type="text/javascript" src="https://www.google.com/jsapi"></sc
ript> | |
68 <script type="text/javascript">google.load("elements", "1", {packages:
"transliteration"});</script> | |
69 <script type="text/javascript" src="https://www.google.com/coop/cse/t1
3n?form=cse&t13n_langs=en"></script> | |
70 <script type="text/javascript" src="https://www.google.com/coop/cse/br
and?form=cse&lang=en"></script> | |
71 </td> | |
72 </tr> | |
73 </tbody></table> | |
74 <div id="codesiteContent" class=""> | |
75 <a id="gc-topnav-anchor"></a> | |
76 <div id="gc-topnav"> | |
77 <h1>Google Chrome Extensions (<a href="http://code.google.com/labs/">Lab
s</a>)</h1> | |
78 <ul id="home" class="gc-topnav-tabs"> | |
79 <li id="home_link"> | |
80 <a href="index.html" title="Google Chrome Extensions home page">Home
</a> | |
81 </li> | |
82 <li id="docs_link"> | |
83 <a href="docs.html" title="Official Google Chrome Extensions documen
tation">Docs</a> | |
84 </li> | |
85 <li id="faq_link"> | |
86 <a href="faq.html" title="Answers to frequently asked questions abou
t Google Chrome Extensions">FAQ</a> | |
87 </li> | |
88 <li id="samples_link"> | |
89 <a href="samples.html" title="Sample extensions (with source code)">
Samples</a> | |
90 </li> | |
91 <li id="group_link"> | |
92 <a href="http://groups.google.com/a/chromium.org/group/chromium-exte
nsions" title="Google Chrome Extensions developer forum">Group</a> | |
93 </li> | |
94 <li id="so_link"> | |
95 <a href="http://stackoverflow.com/questions/tagged/google-chrome-ext
ension" title="[google-chrome-extension] tag on Stack Overflow">Questions?</a> | |
96 </li> | |
97 </ul> | |
98 </div> <!-- end gc-topnav --> | |
99 <div class="g-section g-tpl-170"> | |
100 <!-- SIDENAV --> | |
101 <div class="g-unit g-first" id="gc-toc"> | |
102 <ul> | |
103 <li><a href="getstarted.html">Getting Started</a></li> | |
104 <li><a href="overview.html">Overview</a></li> | |
105 <li><a href="whats_new.html">What's New?</a></li> | |
106 <li><h2><a href="devguide.html">Developer's Guide</a></h2> | |
107 <ul> | |
108 <li>Browser UI | |
109 <ul> | |
110 <li><a href="browserAction.html">Browser Actions</a></li> | |
111 <li><a href="contextMenus.html">Context Menus</a></li> | |
112 <li><a href="notifications.html">Desktop Notifications</a></li
> | |
113 <li><a href="omnibox.html">Omnibox</a></li> | |
114 <li><a href="options.html">Options Pages</a></li> | |
115 <li><a href="override.html">Override Pages</a></li> | |
116 <li><a href="pageAction.html">Page Actions</a></li> | |
117 </ul> | |
118 </li> | |
119 <li>Browser Interaction | |
120 <ul> | |
121 <li><a href="bookmarks.html">Bookmarks</a></li> | |
122 <li><a href="cookies.html">Cookies</a></li> | |
123 <li><a href="devtools.html">Developer Tools</a></li> | |
124 <li><a href="events.html">Events</a></li> | |
125 <li><a href="history.html">History</a></li> | |
126 <li><a href="management.html">Management</a></li> | |
127 <li><a href="tabs.html">Tabs</a></li> | |
128 <li><a href="windows.html">Windows</a></li> | |
129 </ul> | |
130 </li> | |
131 <li>Implementation | |
132 <ul> | |
133 <li><a href="a11y.html">Accessibility</a></li> | |
134 <li><a href="background_pages.html">Background Pages</a></li> | |
135 <li><a href="content_scripts.html">Content Scripts</a></li> | |
136 <li><a href="xhr.html">Cross-Origin XHR</a></li> | |
137 <li><a href="i18n.html">Internationalization</a></li> | |
138 <li><a href="messaging.html">Message Passing</a></li> | |
139 <li><a href="permissions.html">Optional Permissions</a></li> | |
140 <li><a href="npapi.html">NPAPI Plugins</a></li> | |
141 </ul> | |
142 </li> | |
143 <li>Finishing | |
144 <ul> | |
145 <li><a href="hosting.html">Hosting</a></li> | |
146 <li><a href="external_extensions.html">Other Deployment Option
s</a></li> | |
147 </ul> | |
148 </li> | |
149 </ul> | |
150 </li> | |
151 <li><h2><a href="apps.html">Packaged Apps</a></h2></li> | |
152 <li><h2><a href="tutorials.html">Tutorials</a></h2> | |
153 <ul> | |
154 <li><a href="tut_debugging.html">Debugging</a></li> | |
155 <li><a href="tut_analytics.html">Google Analytics</a></li> | |
156 <li><a href="tut_oauth.html">OAuth</a></li> | |
157 </ul> | |
158 </li> | |
159 <li><h2>Reference</h2> | |
160 <ul> | |
161 <li>Formats | |
162 <ul> | |
163 <li><a href="manifest.html">Manifest Files</a></li> | |
164 <li><a href="match_patterns.html">Match Patterns</a></li> | |
165 </ul> | |
166 </li> | |
167 <li><a href="permission_warnings.html">Permission Warnings</a></li
> | |
168 <li><a href="api_index.html">chrome.* APIs</a></li> | |
169 <li><a href="api_other.html">Other APIs</a></li> | |
170 </ul> | |
171 </li> | |
172 <li><h2><a href="samples.html">Samples</a></h2></li> | |
173 <div class="line"> </div> | |
174 <li><h2>More</h2> | |
175 <ul> | |
176 <li><a href="http://code.google.com/chrome/webstore/docs/index.htm
l">Chrome Web Store</a></li> | |
177 <li><a href="http://code.google.com/chrome/apps/docs/developers_gu
ide.html">Hosted Apps</a></li> | |
178 <li><a href="themes.html">Themes</a></li> | |
179 </ul> | |
180 </li> | |
181 </ul> | |
182 </div> | |
183 <script> | |
184 initToggles(); | |
185 </script> | |
186 <div class="g-unit" id="gc-pagecontent"> | |
187 <div id="pageTitle"> | |
188 <h1 class="page_title">Proxy Settings</h1> | |
189 </div> | |
190 <!-- TABLE OF CONTENTS --> | |
191 <div id="toc"> | |
192 <h2>Contents</h2> | |
193 <ol> | |
194 <li> | |
195 <a href="#manifest">Manifest</a> | |
196 <ol> | |
197 </ol> | |
198 </li><li> | |
199 <a href="#description">Objects and properties</a> | |
200 <ol> | |
201 <li> | |
202 <a href="#proxy_modes">Proxy modes</a> | |
203 </li><li> | |
204 <a href="#proxy_rules">Proxy rules</a> | |
205 </li><li> | |
206 <a href="#proxy_server_objects">Proxy server objects</a> | |
207 </li><li> | |
208 <a href="#bypass_list">Bypass list</a> | |
209 </li> | |
210 </ol> | |
211 </li><li> | |
212 <a href="#overview-examples">Examples</a> | |
213 <ol> | |
214 </ol> | |
215 </li> | |
216 <li> | |
217 <a href="#apiReference">API reference: chrome.proxy</a> | |
218 <ol> | |
219 <li> | |
220 <a href="#properties">Properties</a> | |
221 <ol> | |
222 <li> | |
223 <a href="#property-settings">settings</a> | |
224 </li> | |
225 </ol> | |
226 </li> | |
227 <li> | |
228 <a href="#global-events">Events</a> | |
229 <ol> | |
230 <li> | |
231 <a href="#event-onProxyError">onProxyError</a> | |
232 </li> | |
233 </ol> | |
234 </li> | |
235 <li> | |
236 <a href="#types">Types</a> | |
237 <ol> | |
238 <li> | |
239 <a href="#type-ProxyServer">ProxyServer</a> | |
240 <ol> | |
241 </ol> | |
242 </li><li> | |
243 <a href="#type-ProxyRules">ProxyRules</a> | |
244 <ol> | |
245 </ol> | |
246 </li><li> | |
247 <a href="#type-PacScript">PacScript</a> | |
248 <ol> | |
249 </ol> | |
250 </li><li> | |
251 <a href="#type-ProxyConfig">ProxyConfig</a> | |
252 <ol> | |
253 </ol> | |
254 </li> | |
255 </ol> | |
256 </li> | |
257 </ol> | |
258 </li> | |
259 </ol> | |
260 </div> | |
261 <!-- /TABLE OF CONTENTS --> | |
262 <!-- Standard content lead-in for experimental API pages --> | |
263 <!-- STATIC CONTENT PLACEHOLDER --> | |
264 <div id="static"><div id="pageData-name" class="pageData">Proxy Settings
</div> | |
265 <!-- BEGIN AUTHORED CONTENT --> | |
266 <p id="classSummary"> | |
267 Use the <code>chrome.proxy</code> module to manage Chrome's | |
268 proxy settings. This module relies on the <a href="types.html#ChromeSetting"> | |
269 ChromeSetting prototype of the type API</a> for getting and setting the proxy | |
270 configuration. | |
271 </p> | |
272 <h2 id="manifest">Manifest</h2> | |
273 <p>You must declare the "proxy" permission | |
274 in the <a href="manifest.html">extension manifest</a> | |
275 to use the proxy settings API. | |
276 For example:</p> | |
277 <pre>{ | |
278 "name": "My extension", | |
279 ... | |
280 <b>"permissions": [ | |
281 "proxy" | |
282 ]</b>, | |
283 ... | |
284 }</pre> | |
285 <h2 id="description">Objects and properties</h2> | |
286 <p> | |
287 Proxy settings are defined in a | |
288 <a href="#type-ProxyConfig"><code>ProxyConfig</code></a> object. Depending on | |
289 Chrome's proxy settings, the settings may contain | |
290 <a href="#type-ProxyRules"><code>ProxyRules</code></a> or a <a href="#type-PacSc
ript"><code>PacScript</code></a>. | |
291 </p> | |
292 <h3 id="proxy_modes">Proxy modes</h3> | |
293 <p> | |
294 A ProxyConfig object's <code>mode</code> attribute determines the overall | |
295 behavior of Chrome with regards to proxy usage. It can take the following | |
296 values: | |
297 </p><dl> | |
298 <dt><code>direct</code></dt> | |
299 <dd>In <code>direct</code> mode all connections are created directly, without | |
300 any proxy involved. This mode allows no further parameters in the | |
301 <code>ProxyConfig</code> object.</dd> | |
302 <dt><code>auto_detect</code></dt> | |
303 <dd>In <code>auto_detect</code> mode the proxy configuration is determined by | |
304 a PAC script that can be downloaded at | |
305 <a href="http://wpad/wpad.dat">http://wpad/wpad.dat</a>. | |
306 This mode allows no further parameters in the <code>ProxyConfig</code> | |
307 object.</dd> | |
308 <dt><code>pac_script</code></dt> | |
309 <dd>In <code>pac_script</code> mode the proxy configuration is determined by | |
310 a PAC script that is either retrieved from the URL specified in the | |
311 <a href="#type-PacScript"><code>PacScript</code></a> object or | |
312 taken literally from the <code>data</code> element specified in the | |
313 <a href="#type-PacScript"><code>PacScript</code></a> object. | |
314 Besides this, this mode allows no further parameters in the | |
315 <code>ProxyConfig</code> object.</dd> | |
316 <dt><code>fixed_servers</code></dt> | |
317 <dd>In <code>fixed_servers</code> mode the proxy configuration is codified in | |
318 a <a href="#type-ProxyRules><code>ProxyRules"><code>ProxyRules</code>
</a> | |
319 object. Its structure is described in <a href="#proxy_rules">Proxy rules</a>. | |
320 Besides this, the <code>fixed_servers</code> mode allows no further parameters | |
321 in the <code>ProxyConfig</code> object.</dd> | |
322 <dt><code>system</code></dt> | |
323 <dd>In <code>system</code> mode the proxy configuration is taken from the | |
324 operating system. This mode allows no further parameters in the | |
325 <code>ProxyConfig</code> object. Note that the <code>system</code> mode is | |
326 different from setting no proxy configuration. In the latter case, Chrome | |
327 falls back to the system settings only if no command-line options influence | |
328 the proxy configuration.</dd> | |
329 </dl> | |
330 <p></p> | |
331 <h3 id="proxy_rules">Proxy rules</h3> | |
332 <p> | |
333 The <a href="#type-ProxyRules"><code>ProxyRules</code></a> object can contain | |
334 either a <code>singleProxy</code> attribute or a subset of | |
335 <code>proxyForHttp</code>, <code>proxyForHttps</code>, <code>proxyForFtp</code>, | |
336 and <code>fallbackProxy</code>. | |
337 </p> | |
338 <p> | |
339 In the first case, HTTP, HTTPS and FTP traffic is proxied through the specified | |
340 proxy server. Other traffic is sent directly. In the latter case the behavior is | |
341 slightly more subtle: If a proxy server is configured for the HTTP, HTTPS or FTP | |
342 protocol, the respective traffic is proxied through the specified server. If no | |
343 such proxy server is specified or traffic uses a different protocol than HTTP, | |
344 HTTPS or FTP, the <code>fallbackProxy</code> is used. If no | |
345 <code>fallbackProxy</code> is specified, traffic is sent directly without a | |
346 proxy server. | |
347 </p> | |
348 <h3 id="proxy_server_objects">Proxy server objects</h3> | |
349 <p> | |
350 A proxy server is configured in a | |
351 <a href="#type-ProxyServer"><code>ProxyServer</code></a> object. The connection | |
352 to the proxy server (defined by the <code>host</code> attribute) uses the | |
353 protocol defined in the <code>scheme</code> attribute. If no <code>scheme</code> | |
354 is specified, the proxy connection defaults to <code>http</code>. | |
355 </p> | |
356 <p> | |
357 If no <code>port</code> is defined in a | |
358 <a href="#type-ProxyServer"><code>ProxyServer</code></a> object, the port is | |
359 derived from the scheme. The default ports are: | |
360 </p><table> | |
361 <tbody><tr><th>Scheme</th><th>Port</th></tr> | |
362 <tr><td>http</td><td>80</td></tr> | |
363 <tr><td>https</td><td>443</td></tr> | |
364 <tr><td>socks4</td><td>1080</td></tr> | |
365 <tr><td>socks5</td><td>1080</td></tr> | |
366 </tbody></table> | |
367 <p></p> | |
368 <h3 id="bypass_list">Bypass list</h3> | |
369 <p> | |
370 Individual servers may be excluded from being proxied with the | |
371 <code>bypassList</code>. This list may contain the following entries: | |
372 </p><dl> | |
373 <dt><code>[<em><scheme></em>://]<em><host-pattern></em>[:<em><p
ort></em>]</code></dt> | |
374 <dd>Match all hostnames that match the pattern <em><host-pattern></em>.<
br> | |
375 Examples: <code>"foobar.com", "*foobar.com", "*.foobar.com", "*foobar.com:99", | |
376 "https://x.*.y.com:99"</code></dd> | |
377 <dt><code>[<em><scheme></em>://]<em><ip-literal></em>[:<em><por
t></em>]</code></dt> | |
378 <dd>Match URLs that are IP address literals.<br> | |
379 Conceptually this is the similar to the first case, but with special cases | |
380 to handle IP literal canonicalization. For example, matching | |
381 on "[0:0:0::1]" is the same as matching on "[::1]" because | |
382 the IPv6 canonicalization is done internally.<br> | |
383 Examples: <code>"127.0.1", "[0:0::1]", "[::1]", "http://[::1]:99"</code></dd> | |
384 <dt><code><em><ip-literal></em>/<em><prefix-length-in-bits></em></
code></dt> | |
385 <dd>Match any URL containing an IP literal within the given range. The IP | |
386 range is specified using CIDR notation.<br> | |
387 Examples: <code>"192.168.1.1/16", "fefe:13::abc/33"</code></dd> | |
388 <dt><code><local></code></dt> | |
389 <dd>Match local addresses. An address is local if the host is "127.0.0.1", | |
390 "::1", or "localhost".<br> | |
391 Example: <code>"<local>"</code></dd> | |
392 </dl> | |
393 <h2 id="overview-examples">Examples</h2> | |
394 <p> | |
395 The following code sets a SOCKS 5 proxy for HTTP connections to all servers but | |
396 foobar.com and uses direct connections for all other protocols. The settings | |
397 apply to regular and incognito windows, as incognito windows inherit settings | |
398 from regular windows. Please also consult the <a href="types.html#ChromeSetting"
>Types API</a> documentation. | |
399 </p> | |
400 <pre>var config = { | |
401 mode: "fixed_servers", | |
402 rules: { | |
403 proxyForHttp: { | |
404 scheme: "socks5", | |
405 host: "1.2.3.4" | |
406 }, | |
407 bypassList: ["foobar.com"] | |
408 } | |
409 }; | |
410 chrome.proxy.settings.set( | |
411 {value: config, scope: 'regular'}, | |
412 function() {}); | |
413 </pre> | |
414 <p> | |
415 The following code sets a custom PAC script. | |
416 </p> | |
417 <pre>var config = { | |
418 mode: "pac_script", | |
419 pacScript: { | |
420 data: "function FindProxyForURL(url, host) {\n" + | |
421 " if (host == 'foobar.com')\n" + | |
422 " return 'PROXY blackhole:80';\n" + | |
423 " return 'DIRECT';\n" + | |
424 "}" | |
425 } | |
426 }; | |
427 chrome.proxy.settings.set( | |
428 {value: config, scope: 'regular'}, | |
429 function() {}); | |
430 </pre> | |
431 <p> | |
432 The next snippet queries the currently effective proxy settings. The effective | |
433 proxy settings can be determined by another extension or by a policy. See the <a
href="types.html#ChromeSetting">Types API</a> documentation for details. | |
434 </p> | |
435 <pre>chrome.proxy.settings.get( | |
436 {'incognito': false}, | |
437 function(config) {console.log(JSON.stringify(config));}); | |
438 </pre> | |
439 <p> | |
440 Note that the <code>value</code> object passed to <code>set()</code> is not | |
441 identical to the <code>value</code> object passed to callback function of | |
442 <code>get()</code>. The latter will contain a | |
443 <code>rules.proxyForHttp.port</code> element. | |
444 </p> | |
445 <!-- END AUTHORED CONTENT --> | |
446 </div> | |
447 <!-- API PAGE --> | |
448 <div class="apiPage"> | |
449 <a name="apiReference"></a> | |
450 <h2>API reference: chrome.proxy</h2> | |
451 <!-- PROPERTIES --> | |
452 <div class="apiGroup"> | |
453 <a name="properties"></a> | |
454 <h3 id="properties">Properties</h3> | |
455 <div> | |
456 <a name="property-settings"></a> | |
457 <h4>settings</h4> | |
458 <div class="summary"> | |
459 <!-- Note: intentionally longer 80 columns --> | |
460 <span>chrome.proxy.</span><span>settings</span> | |
461 </div> | |
462 <div> | |
463 <dt> | |
464 <var>settings</var> | |
465 <em> | |
466 <!-- TYPE --> | |
467 <div style="display:inline"> | |
468 ( | |
469 <span id="typeTemplate"> | |
470 <span> | |
471 <a>types.ChromeSetting</a> | |
472 </span> | |
473 </span> | |
474 ) | |
475 </div> | |
476 </em> | |
477 </dt> | |
478 <dd>Proxy settings to be used. The value of this setting is a ProxyCon
fig object.</dd> | |
479 <!-- OBJECT PROPERTIES --> | |
480 <!-- OBJECT METHODS --> | |
481 <!-- OBJECT EVENT FIELDS --> | |
482 <!-- FUNCTION PARAMETERS --> | |
483 </div> | |
484 </div> | |
485 </div> <!-- /apiGroup --> | |
486 <!-- METHODS --> | |
487 <!-- /apiGroup --> | |
488 <!-- EVENTS --> | |
489 <div id="eventsTemplate" class="apiGroup"> | |
490 <a name="global-events"></a> | |
491 <h3>Events</h3> | |
492 <!-- iterates over all events --> | |
493 <div class="apiItem"> | |
494 <a name="event-onProxyError"></a> | |
495 <h4>onProxyError</h4> | |
496 <div class="summary"> | |
497 <!-- Note: intentionally longer 80 columns --> | |
498 <span class="subdued">chrome.proxy.</span><span>onProxyError</sp
an><span class="subdued">.addListener</span>(function(<span>object details</span
>) <span class="subdued">{...}</span><span></span>); | |
499 </div> | |
500 <div class="description"> | |
501 <p>Notifies about proxy errors.</p> | |
502 <!-- LISTENER PARAMETERS --> | |
503 <div> | |
504 <h4>Listener parameters</h4> | |
505 <dl> | |
506 <div> | |
507 <div> | |
508 <dt> | |
509 <var>details</var> | |
510 <em> | |
511 <!-- TYPE --> | |
512 <div style="display:inline"> | |
513 ( | |
514 <span id="typeTemplate"> | |
515 <span> | |
516 <span>object</span> | |
517 </span> | |
518 </span> | |
519 ) | |
520 </div> | |
521 </em> | |
522 </dt> | |
523 <dd class="todo"> | |
524 Undocumented. | |
525 </dd> | |
526 <!-- OBJECT PROPERTIES --> | |
527 <dd> | |
528 <dl> | |
529 <div> | |
530 <div> | |
531 <dt> | |
532 <var>fatal</var> | |
533 <em> | |
534 <!-- TYPE --> | |
535 <div style="display:inline"> | |
536 ( | |
537 <span id="typeTemplate"> | |
538 <span> | |
539 <span>boolean</span> | |
540 </span> | |
541 </span> | |
542 ) | |
543 </div> | |
544 </em> | |
545 </dt> | |
546 <dd>If true, the error was fatal and the network transaction was abort
ed. Otherwise, a direct connection is used instead.</dd> | |
547 <!-- OBJECT PROPERTIES --> | |
548 <!-- OBJECT METHODS --> | |
549 <!-- OBJECT EVENT FIELDS --> | |
550 <!-- FUNCTION PARAMETERS --> | |
551 </div> | |
552 </div><div> | |
553 <div> | |
554 <dt> | |
555 <var>error</var> | |
556 <em> | |
557 <!-- TYPE --> | |
558 <div style="display:inline"> | |
559 ( | |
560 <span id="typeTemplate"> | |
561 <span> | |
562 <span>string</span> | |
563 </span> | |
564 </span> | |
565 ) | |
566 </div> | |
567 </em> | |
568 </dt> | |
569 <dd>The error description.</dd> | |
570 <!-- OBJECT PROPERTIES --> | |
571 <!-- OBJECT METHODS --> | |
572 <!-- OBJECT EVENT FIELDS --> | |
573 <!-- FUNCTION PARAMETERS --> | |
574 </div> | |
575 </div><div> | |
576 <div> | |
577 <dt> | |
578 <var>details</var> | |
579 <em> | |
580 <!-- TYPE --> | |
581 <div style="display:inline"> | |
582 ( | |
583 <span id="typeTemplate"> | |
584 <span> | |
585 <span>string</span> | |
586 </span> | |
587 </span> | |
588 ) | |
589 </div> | |
590 </em> | |
591 </dt> | |
592 <dd>Additional details about the error such as a JavaScript runtime er
ror.</dd> | |
593 <!-- OBJECT PROPERTIES --> | |
594 <!-- OBJECT METHODS --> | |
595 <!-- OBJECT EVENT FIELDS --> | |
596 <!-- FUNCTION PARAMETERS --> | |
597 </div> | |
598 </div> | |
599 </dl> | |
600 </dd> | |
601 <!-- OBJECT METHODS --> | |
602 <!-- OBJECT EVENT FIELDS --> | |
603 <!-- FUNCTION PARAMETERS --> | |
604 </div> | |
605 </div> | |
606 </dl> | |
607 </div> | |
608 <!-- EXTRA PARAMETERS --> | |
609 <!-- LISTENER RETURN VALUE --> | |
610 <dl> | |
611 </dl> | |
612 </div> <!-- /description --> | |
613 <!-- /description --> | |
614 </div> <!-- /apiItem --> | |
615 </div> <!-- /apiGroup --> | |
616 <!-- TYPES --> | |
617 <div class="apiGroup"> | |
618 <a name="types"></a> | |
619 <h3 id="types">Types</h3> | |
620 <!-- iterates over all types --> | |
621 <div class="apiItem"> | |
622 <a name="type-ProxyServer"></a> | |
623 <h4>ProxyServer</h4> | |
624 <div> | |
625 <dt> | |
626 <em> | |
627 <!-- TYPE --> | |
628 <div style="display:inline"> | |
629 ( | |
630 <span id="typeTemplate"> | |
631 <span> | |
632 <span>object</span> | |
633 </span> | |
634 </span> | |
635 ) | |
636 </div> | |
637 </em> | |
638 </dt> | |
639 <dd>An object encapsulating a single proxy server's specification.</dd
> | |
640 <!-- OBJECT PROPERTIES --> | |
641 <dd> | |
642 <dl> | |
643 <div> | |
644 <div> | |
645 <dt> | |
646 <var>scheme</var> | |
647 <em> | |
648 <!-- TYPE --> | |
649 <div style="display:inline"> | |
650 ( | |
651 <span class="optional">optional</span> | |
652 <span class="enum">enumerated</span> | |
653 <span id="typeTemplate"> | |
654 <span> | |
655 <span>string</span> | |
656 <span>["http", "https", "socks4", "socks5"]</span> | |
657 </span> | |
658 </span> | |
659 ) | |
660 </div> | |
661 </em> | |
662 </dt> | |
663 <dd>The scheme (protocol) of the proxy server itself. Defaults to 'htt
p'.</dd> | |
664 <!-- OBJECT PROPERTIES --> | |
665 <!-- OBJECT METHODS --> | |
666 <!-- OBJECT EVENT FIELDS --> | |
667 <!-- FUNCTION PARAMETERS --> | |
668 </div> | |
669 </div><div> | |
670 <div> | |
671 <dt> | |
672 <var>host</var> | |
673 <em> | |
674 <!-- TYPE --> | |
675 <div style="display:inline"> | |
676 ( | |
677 <span id="typeTemplate"> | |
678 <span> | |
679 <span>string</span> | |
680 </span> | |
681 </span> | |
682 ) | |
683 </div> | |
684 </em> | |
685 </dt> | |
686 <dd>The URI of the proxy server. This must be an ASCII hostname (in Pu
nycode format). IDNA is not supported, yet.</dd> | |
687 <!-- OBJECT PROPERTIES --> | |
688 <!-- OBJECT METHODS --> | |
689 <!-- OBJECT EVENT FIELDS --> | |
690 <!-- FUNCTION PARAMETERS --> | |
691 </div> | |
692 </div><div> | |
693 <div> | |
694 <dt> | |
695 <var>port</var> | |
696 <em> | |
697 <!-- TYPE --> | |
698 <div style="display:inline"> | |
699 ( | |
700 <span class="optional">optional</span> | |
701 <span id="typeTemplate"> | |
702 <span> | |
703 <span>integer</span> | |
704 </span> | |
705 </span> | |
706 ) | |
707 </div> | |
708 </em> | |
709 </dt> | |
710 <dd>The port of the proxy server. Defaults to a port that depends on t
he scheme.</dd> | |
711 <!-- OBJECT PROPERTIES --> | |
712 <!-- OBJECT METHODS --> | |
713 <!-- OBJECT EVENT FIELDS --> | |
714 <!-- FUNCTION PARAMETERS --> | |
715 </div> | |
716 </div> | |
717 </dl> | |
718 </dd> | |
719 <!-- OBJECT METHODS --> | |
720 <!-- OBJECT EVENT FIELDS --> | |
721 <!-- FUNCTION PARAMETERS --> | |
722 </div> | |
723 </div><div class="apiItem"> | |
724 <a name="type-ProxyRules"></a> | |
725 <h4>ProxyRules</h4> | |
726 <div> | |
727 <dt> | |
728 <em> | |
729 <!-- TYPE --> | |
730 <div style="display:inline"> | |
731 ( | |
732 <span id="typeTemplate"> | |
733 <span> | |
734 <span>object</span> | |
735 </span> | |
736 </span> | |
737 ) | |
738 </div> | |
739 </em> | |
740 </dt> | |
741 <dd>An object encapsulating the set of proxy rules for all protocols.
Use either 'singleProxy' or (a subset of) 'proxyForHttp', 'proxyForHttps', 'prox
yForFtp' and 'fallbackProxy'.</dd> | |
742 <!-- OBJECT PROPERTIES --> | |
743 <dd> | |
744 <dl> | |
745 <div> | |
746 <div> | |
747 <dt> | |
748 <var>singleProxy</var> | |
749 <em> | |
750 <!-- TYPE --> | |
751 <div style="display:inline"> | |
752 ( | |
753 <span class="optional">optional</span> | |
754 <span id="typeTemplate"> | |
755 <span> | |
756 <a href="proxy.html#type-ProxyServer">ProxyServer</a> | |
757 </span> | |
758 </span> | |
759 ) | |
760 </div> | |
761 </em> | |
762 </dt> | |
763 <dd>The proxy server to be used for all per-URL requests (that is http
, https, and ftp).</dd> | |
764 <!-- OBJECT PROPERTIES --> | |
765 <!-- OBJECT METHODS --> | |
766 <!-- OBJECT EVENT FIELDS --> | |
767 <!-- FUNCTION PARAMETERS --> | |
768 </div> | |
769 </div><div> | |
770 <div> | |
771 <dt> | |
772 <var>proxyForHttp</var> | |
773 <em> | |
774 <!-- TYPE --> | |
775 <div style="display:inline"> | |
776 ( | |
777 <span class="optional">optional</span> | |
778 <span id="typeTemplate"> | |
779 <span> | |
780 <a href="proxy.html#type-ProxyServer">ProxyServer</a> | |
781 </span> | |
782 </span> | |
783 ) | |
784 </div> | |
785 </em> | |
786 </dt> | |
787 <dd>The proxy server to be used for HTTP requests.</dd> | |
788 <!-- OBJECT PROPERTIES --> | |
789 <!-- OBJECT METHODS --> | |
790 <!-- OBJECT EVENT FIELDS --> | |
791 <!-- FUNCTION PARAMETERS --> | |
792 </div> | |
793 </div><div> | |
794 <div> | |
795 <dt> | |
796 <var>proxyForHttps</var> | |
797 <em> | |
798 <!-- TYPE --> | |
799 <div style="display:inline"> | |
800 ( | |
801 <span class="optional">optional</span> | |
802 <span id="typeTemplate"> | |
803 <span> | |
804 <a href="proxy.html#type-ProxyServer">ProxyServer</a> | |
805 </span> | |
806 </span> | |
807 ) | |
808 </div> | |
809 </em> | |
810 </dt> | |
811 <dd>The proxy server to be used for HTTPS requests.</dd> | |
812 <!-- OBJECT PROPERTIES --> | |
813 <!-- OBJECT METHODS --> | |
814 <!-- OBJECT EVENT FIELDS --> | |
815 <!-- FUNCTION PARAMETERS --> | |
816 </div> | |
817 </div><div> | |
818 <div> | |
819 <dt> | |
820 <var>proxyForFtp</var> | |
821 <em> | |
822 <!-- TYPE --> | |
823 <div style="display:inline"> | |
824 ( | |
825 <span class="optional">optional</span> | |
826 <span id="typeTemplate"> | |
827 <span> | |
828 <a href="proxy.html#type-ProxyServer">ProxyServer</a> | |
829 </span> | |
830 </span> | |
831 ) | |
832 </div> | |
833 </em> | |
834 </dt> | |
835 <dd>The proxy server to be used for FTP requests.</dd> | |
836 <!-- OBJECT PROPERTIES --> | |
837 <!-- OBJECT METHODS --> | |
838 <!-- OBJECT EVENT FIELDS --> | |
839 <!-- FUNCTION PARAMETERS --> | |
840 </div> | |
841 </div><div> | |
842 <div> | |
843 <dt> | |
844 <var>fallbackProxy</var> | |
845 <em> | |
846 <!-- TYPE --> | |
847 <div style="display:inline"> | |
848 ( | |
849 <span class="optional">optional</span> | |
850 <span id="typeTemplate"> | |
851 <span> | |
852 <a href="proxy.html#type-ProxyServer">ProxyServer</a> | |
853 </span> | |
854 </span> | |
855 ) | |
856 </div> | |
857 </em> | |
858 </dt> | |
859 <dd>The proxy server to be used for everthing else or if any of the sp
ecific proxyFor... is not specified.</dd> | |
860 <!-- OBJECT PROPERTIES --> | |
861 <!-- OBJECT METHODS --> | |
862 <!-- OBJECT EVENT FIELDS --> | |
863 <!-- FUNCTION PARAMETERS --> | |
864 </div> | |
865 </div><div> | |
866 <div> | |
867 <dt> | |
868 <var>bypassList</var> | |
869 <em> | |
870 <!-- TYPE --> | |
871 <div style="display:inline"> | |
872 ( | |
873 <span class="optional">optional</span> | |
874 <span id="typeTemplate"> | |
875 <span> | |
876 <span> | |
877 array of <span><span> | |
878 <span> | |
879 <span>string</span> | |
880 </span> | |
881 </span></span> | |
882 </span> | |
883 </span> | |
884 </span> | |
885 ) | |
886 </div> | |
887 </em> | |
888 </dt> | |
889 <dd>List of servers to connect to without a proxy server.</dd> | |
890 <!-- OBJECT PROPERTIES --> | |
891 <!-- OBJECT METHODS --> | |
892 <!-- OBJECT EVENT FIELDS --> | |
893 <!-- FUNCTION PARAMETERS --> | |
894 </div> | |
895 </div> | |
896 </dl> | |
897 </dd> | |
898 <!-- OBJECT METHODS --> | |
899 <!-- OBJECT EVENT FIELDS --> | |
900 <!-- FUNCTION PARAMETERS --> | |
901 </div> | |
902 </div><div class="apiItem"> | |
903 <a name="type-PacScript"></a> | |
904 <h4>PacScript</h4> | |
905 <div> | |
906 <dt> | |
907 <em> | |
908 <!-- TYPE --> | |
909 <div style="display:inline"> | |
910 ( | |
911 <span id="typeTemplate"> | |
912 <span> | |
913 <span>object</span> | |
914 </span> | |
915 </span> | |
916 ) | |
917 </div> | |
918 </em> | |
919 </dt> | |
920 <dd>An object holding proxy auto-config information. Exactly one of th
e fields should be non-empty.</dd> | |
921 <!-- OBJECT PROPERTIES --> | |
922 <dd> | |
923 <dl> | |
924 <div> | |
925 <div> | |
926 <dt> | |
927 <var>url</var> | |
928 <em> | |
929 <!-- TYPE --> | |
930 <div style="display:inline"> | |
931 ( | |
932 <span class="optional">optional</span> | |
933 <span id="typeTemplate"> | |
934 <span> | |
935 <span>string</span> | |
936 </span> | |
937 </span> | |
938 ) | |
939 </div> | |
940 </em> | |
941 </dt> | |
942 <dd>URL of the PAC file to be used.</dd> | |
943 <!-- OBJECT PROPERTIES --> | |
944 <!-- OBJECT METHODS --> | |
945 <!-- OBJECT EVENT FIELDS --> | |
946 <!-- FUNCTION PARAMETERS --> | |
947 </div> | |
948 </div><div> | |
949 <div> | |
950 <dt> | |
951 <var>data</var> | |
952 <em> | |
953 <!-- TYPE --> | |
954 <div style="display:inline"> | |
955 ( | |
956 <span class="optional">optional</span> | |
957 <span id="typeTemplate"> | |
958 <span> | |
959 <span>string</span> | |
960 </span> | |
961 </span> | |
962 ) | |
963 </div> | |
964 </em> | |
965 </dt> | |
966 <dd>A PAC script.</dd> | |
967 <!-- OBJECT PROPERTIES --> | |
968 <!-- OBJECT METHODS --> | |
969 <!-- OBJECT EVENT FIELDS --> | |
970 <!-- FUNCTION PARAMETERS --> | |
971 </div> | |
972 </div><div> | |
973 <div> | |
974 <dt> | |
975 <var>mandatory</var> | |
976 <em> | |
977 <!-- TYPE --> | |
978 <div style="display:inline"> | |
979 ( | |
980 <span class="optional">optional</span> | |
981 <span id="typeTemplate"> | |
982 <span> | |
983 <span>boolean</span> | |
984 </span> | |
985 </span> | |
986 ) | |
987 </div> | |
988 </em> | |
989 </dt> | |
990 <dd>If true, an invalid PAC script will prevent the network stack from
falling back to direct connections. Defaults to false.</dd> | |
991 <!-- OBJECT PROPERTIES --> | |
992 <!-- OBJECT METHODS --> | |
993 <!-- OBJECT EVENT FIELDS --> | |
994 <!-- FUNCTION PARAMETERS --> | |
995 </div> | |
996 </div> | |
997 </dl> | |
998 </dd> | |
999 <!-- OBJECT METHODS --> | |
1000 <!-- OBJECT EVENT FIELDS --> | |
1001 <!-- FUNCTION PARAMETERS --> | |
1002 </div> | |
1003 </div><div class="apiItem"> | |
1004 <a name="type-ProxyConfig"></a> | |
1005 <h4>ProxyConfig</h4> | |
1006 <div> | |
1007 <dt> | |
1008 <em> | |
1009 <!-- TYPE --> | |
1010 <div style="display:inline"> | |
1011 ( | |
1012 <span id="typeTemplate"> | |
1013 <span> | |
1014 <span>object</span> | |
1015 </span> | |
1016 </span> | |
1017 ) | |
1018 </div> | |
1019 </em> | |
1020 </dt> | |
1021 <dd>An object encapsulating a complete proxy configuration.</dd> | |
1022 <!-- OBJECT PROPERTIES --> | |
1023 <dd> | |
1024 <dl> | |
1025 <div> | |
1026 <div> | |
1027 <dt> | |
1028 <var>rules</var> | |
1029 <em> | |
1030 <!-- TYPE --> | |
1031 <div style="display:inline"> | |
1032 ( | |
1033 <span class="optional">optional</span> | |
1034 <span id="typeTemplate"> | |
1035 <span> | |
1036 <a href="proxy.html#type-ProxyRules">ProxyRules</a> | |
1037 </span> | |
1038 </span> | |
1039 ) | |
1040 </div> | |
1041 </em> | |
1042 </dt> | |
1043 <dd>The proxy rules describing this configuration. Use this for 'fixed
_servers' mode.</dd> | |
1044 <!-- OBJECT PROPERTIES --> | |
1045 <!-- OBJECT METHODS --> | |
1046 <!-- OBJECT EVENT FIELDS --> | |
1047 <!-- FUNCTION PARAMETERS --> | |
1048 </div> | |
1049 </div><div> | |
1050 <div> | |
1051 <dt> | |
1052 <var>pacScript</var> | |
1053 <em> | |
1054 <!-- TYPE --> | |
1055 <div style="display:inline"> | |
1056 ( | |
1057 <span class="optional">optional</span> | |
1058 <span id="typeTemplate"> | |
1059 <span> | |
1060 <a href="proxy.html#type-PacScript">PacScript</a> | |
1061 </span> | |
1062 </span> | |
1063 ) | |
1064 </div> | |
1065 </em> | |
1066 </dt> | |
1067 <dd>The proxy auto-config (PAC) script for this configuration. Use thi
s for 'pac_script' mode.</dd> | |
1068 <!-- OBJECT PROPERTIES --> | |
1069 <!-- OBJECT METHODS --> | |
1070 <!-- OBJECT EVENT FIELDS --> | |
1071 <!-- FUNCTION PARAMETERS --> | |
1072 </div> | |
1073 </div><div> | |
1074 <div> | |
1075 <dt> | |
1076 <var>mode</var> | |
1077 <em> | |
1078 <!-- TYPE --> | |
1079 <div style="display:inline"> | |
1080 ( | |
1081 <span class="enum">enumerated</span> | |
1082 <span id="typeTemplate"> | |
1083 <span> | |
1084 <span>string</span> | |
1085 <span>["direct", "auto_detect", "pac_script", "fixed_ser
vers", "system"]</span> | |
1086 </span> | |
1087 </span> | |
1088 ) | |
1089 </div> | |
1090 </em> | |
1091 </dt> | |
1092 <dd>'direct' = Never use a proxy<br>'auto_detect' = Auto detect proxy
settings<br>'pac_script' = Use specified PAC script<br>'fixed_servers' = Manuall
y specify proxy servers<br>'system' = Use system proxy settings</dd> | |
1093 <!-- OBJECT PROPERTIES --> | |
1094 <!-- OBJECT METHODS --> | |
1095 <!-- OBJECT EVENT FIELDS --> | |
1096 <!-- FUNCTION PARAMETERS --> | |
1097 </div> | |
1098 </div> | |
1099 </dl> | |
1100 </dd> | |
1101 <!-- OBJECT METHODS --> | |
1102 <!-- OBJECT EVENT FIELDS --> | |
1103 <!-- FUNCTION PARAMETERS --> | |
1104 </div> | |
1105 </div> <!-- /apiItem --> | |
1106 </div> <!-- /apiGroup --> | |
1107 </div> <!-- /apiPage --> | |
1108 </div> <!-- /gc-pagecontent --> | |
1109 </div> <!-- /g-section --> | |
1110 </div> <!-- /codesiteContent --> | |
1111 <div id="gc-footer" --=""> | |
1112 <div class="text"> | |
1113 <p> | |
1114 Except as otherwise <a href="http://code.google.com/policies.html#restrictions
">noted</a>, | |
1115 the content of this page is licensed under the <a rel="license" href="http://c
reativecommons.org/licenses/by/3.0/">Creative Commons | |
1116 Attribution 3.0 License</a>, and code samples are licensed under the | |
1117 <a rel="license" href="http://code.google.com/google_bsd_license.html">BSD Lic
ense</a>. | |
1118 </p> | |
1119 <p> | |
1120 ©2011 Google | |
1121 </p> | |
1122 <!-- begin analytics --> | |
1123 <script src="https://www.google-analytics.com/urchin.js" type="text/javascript">
</script> | |
1124 <script src="https://www.google-analytics.com/ga.js" type="text/javascript"></sc
ript> | |
1125 <script type="text/javascript"> | |
1126 // chrome doc tracking | |
1127 try { | |
1128 var engdocs = _gat._getTracker("YT-10763712-2"); | |
1129 engdocs._trackPageview(); | |
1130 } catch(err) {} | |
1131 // code.google.com site-wide tracking | |
1132 try { | |
1133 _uacct="UA-18071-1"; | |
1134 _uanchor=1; | |
1135 _uff=0; | |
1136 urchinTracker(); | |
1137 } | |
1138 catch(e) {/* urchinTracker not available. */} | |
1139 </script> | |
1140 <!-- end analytics --> | |
1141 </div> | |
1142 </div> <!-- /gc-footer --> | |
1143 </div> <!-- /gc-container --> | |
1144 </body></html> | |
OLD | NEW |