/
50.txt
242 lines (169 loc) · 11 KB
/
50.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
* 文脈
[26] 組織内ネットワークなどで管理者が提供していることがよくあります。
[[プロキシ]]の設定を管理者側で一括管理できるので便利です。
[27] [[WPAD]] により [[PAC]] の [[URL]] 自体を配布することもできます。
* 機能
[32] [[要求メソッド]]により分岐することはできません。
* 処理
[16] [[PACファイル]]自体の取得は、[[プロキシ]]を使わずに直接行う必要があります。
;; [17] 信頼できない[[ネットワーク]]に接続されている場合や、
[[PACファイル]]の取得元が自[[ネットワーク]]外で信頼できない場合
([[HTTPS]] でない場合など) は、[[PACファイル]]も信用してはいけないかもしれません。
[13] [[PACファイル]]を [[JavaScript]] として[[評価]]して得られた
[CODE[FindProxyForURL]] [[関数]]に、[[引数]]として [VAR[URL]] と
[VAR[ホスト]]を与えて実行し、得られた値を[[プロキシ]]の指定として解釈します。
[14] [VAR[ホスト]]は、[VAR[URL]]のうち、[F[ホスト]]の部分です。
;; [15] 便宜上指定されていますが、冗長な情報です [SRC[>>6]]。
[18] 返される値は[[プロキシ]]の指定の[[文字列]]と解釈されますが、これには [CODE[;]]
区切りで複数の指定を連結できます。前の指定の[[プロキシ]]に接続できないとき、
次の指定で接続を試みます。
[7] [[WebSocket]] の場合の、かつての [[Chrome]] は [CODE[ws:]] [[URL]]
を使っていましたが、後に [[HTTP(S) URL]] に変更されました [SRC[>>33]]。
入力 [[URL]] についての規定は [[WebSocket接続の確立]]を参照。
* プロキシの種別
[8]
[FIG(table)[
:name: 種別
:desc: 意味
:name: [CODE[DIRECT]] [SRC[>>6]]
:desc: 直接接続 ([[プロキシ]]なし)
:name: [CODE[PROXY]] [SRC[>>6]]
:desc: [[HTTP]] over [[TCP]]
:name: [CODE[HTTPS]] [SRC[>>4]]
:desc: [[HTTPS]]
:name: [CODE[SOCKS]] [SRC[>>6]]
:desc: [[SOCKS4]] [SRC[>>9]]
:name: [CODE[SOCKS4]]
:desc: [[SOCKS4]]
:name: [CODE[SOCKS5]]
:desc: [[SOCKS5]]
]FIG]
* MIME 型
[10] [[PACファイル]]の[[MIME型]]として、
[CODE(MIME)@en[application/x-ns-proxy-autoconfig]] や
[CODE(MIME)@en[application/x-javascript-config]]
が使われています。
* 発見と更新
[20] 使用する [[PAC]] ファイルの指定は、[[利用者]]が手動で行う他に、
[[WPAD]] により[[ネットワーク]]から自動取得することもできます。
[22] [[PAC]] は適宜変更されるものですから、適当なタイミング・頻度で最新のものを取得し直す必要があるようです。
;; [23] [[ネットワーク設定]]も参照。
* 実装
[24] 大抵の [[Webブラウザー]]が対応しています。
[25] [[Webブラウザー]]以外の[[クライアント]]は対応していないことが多いです。
* メモ
[1] [CITE@ja[@IT:検証:IEの自動Proxy設定とセキュリティ・ゾーン 2.イントラネット・ゾーン]] ([TIME[2009-01-17 19:53:44 +09:00]] 版) <http://www.atmarkit.co.jp/fwin2k/experiments/ieproxy/ieproxy_02.html>
>ある種の自動構成スクリプトを使うと(正確には「return "DIRECT"」を実行すると)、本来「インターネットゾーン」となるべきサイトが「イントラネットゾーン」となってしまうのは、IEの仕様なのだろうか、それとも何か重大なセキュリティ上の脆弱性なのだろうか、気になるところである。そこでこの件を Microsoft Security Response Center(Microsoft社の総合的なセキュリティ担当部署)に問い合わせてみたところ、これは“仕様”であるとの回答を得た。
[2] 元々の [[Netscape]] の文書は <http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html> にあったみたいです。
[3] [CITE[第 17 章 クライアント自動設定ファイルの使用]]
([TIME[2010-12-30 20:25:10 +09:00]] 版)
<https://docs.oracle.com/cd/E19438-01/820-0863/6ncisupt1/index.html>
[FIG(quote)[
[FIGCAPTION[
[5] [CITE[Welcome to Netscape Navigator Version 2.0]]
([TIME[2015-01-24 23:13:02 +09:00]] 版)
<http://web.archive.org/web/20030202175634/http://wp.netscape.com/eng/mozilla/2.0/relnotes/windows-2.0.html>
]FIGCAPTION]
> Automatic Proxy Configuration: It is now easier to specify complicated proxy configurations for an entire site. You can tell the Navigator to use different proxies depending on the URL or host being contacted. It's easier to specify a large number of hosts that should not be using a proxy.
]FIG]
[6] [CITE[Proxy Client Autoconfig File Format]]
([TIME[2015-01-24 23:13:35 +09:00]] 版)
<http://web.archive.org/web/20030202155744/http://wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html>
[4] [CITE[Secure Web Proxy - The Chromium Projects]]
([TIME[2015-03-21 10:14:33 +09:00]] 版)
<https://www.chromium.org/developers/design-documents/secure-web-proxy>
[9] [CITE@en[78176 – PAC: SOCKS return value is not version specific]] ([TIME[2016-04-23 18:05:34 +09:00]] 版) <https://bugzilla.mozilla.org/show_bug.cgi?id=78176>
[11] [CITE@en[Proxy auto-config - Wikipedia, the free encyclopedia]]
([TIME[2016-04-21 07:24:53 +09:00]] 版)
<https://en.wikipedia.org/wiki/Proxy_auto-config>
[12] [CITE@en[378637 – Add support for connecting to HTTP proxy over HTTPS]]
([TIME[2016-04-23 18:34:33 +09:00]] 版)
<https://bugzilla.mozilla.org/show_bug.cgi?id=378637>
[19] [CITE@en[76649 – PAC: dnsDomainIs should match ANY subdomain to an FQDN]]
( ([TIME[2016-05-08 22:35:51 +09:00]]))
<https://bugzilla.mozilla.org/show_bug.cgi?id=76649>
[FIG(quote)[
[FIGCAPTION[
[21] [CITE@en[draft-cooper-webi-wpad-00 - Web Proxy Auto-Discovery Protocol]]
( ([TIME[2016-05-23 03:01:30 +09:00]]))
<https://tools.ietf.org/html/draft-cooper-webi-wpad-00#section-5.6>
]FIGCAPTION]
> The client then requests the CURL via HTTP. When making the request
> it MUST transmit HTTP "Accept" headers indicating what CFILE formats
> it is capable of accepting. For example, Netscape Navigator browsers
> with versions 2.0 and beyond might include the following line in the
> HTTP Request:
> Accept: application/x-ns-proxy-autoconfig
> The client MUST follow HTTP redirect directives (response codes 3xx)
> returned by the server. The client SHOULD send a valid "User-Agent"
> header.
]FIG]
[28] [CITE@en-US[PAC - Glossary | MDN]]
( ([TIME[2016-05-19 00:47:16 +09:00]]))
<https://developer.mozilla.org/en-US/docs/Glossary/PAC>
[29] [CITE@en-US[Proxy Auto-Configuration (PAC) file - Mozilla | MDN]]
( ([TIME[2016-05-23 02:56:38 +09:00]]))
<https://developer.mozilla.org/en-US/docs/Mozilla/Projects/Necko/Proxy_Auto-Configuration_(PAC)_file>
[30] [CITE[chrome.proxy - Google Chrome]]
( ([TIME[2016-06-17 20:21:48 +09:00]]))
<https://developer.chrome.com/extensions/proxy>
[31] [CITE@en[Define the property name for the PAC URL. (#311)]]
([[juangj]]著, [TIME[2016-07-01 06:13:29 +09:00]])
<https://github.com/w3c/webdriver/commit/0aa076ed7d0529d84164e1074e92b7eb003b8291>
[33] [CITE@en[426736 - WebSocket connections not using configured system HTTPS Proxy in MacOS - chromium - Monorail]]
([TIME[2017-08-11 16:57:58 +09:00]])
<https://bugs.chromium.org/p/chromium/issues/detail?id=426736>
[34] [CITE@en[Proxy: if `pac` require a config url]]
([[shs96c]]著, [TIME[2017-08-17 20:52:06 +09:00]])
<https://github.com/w3c/webdriver/commit/ee8c8d1938d7c71009754abda0846808312e959d>
[35] [CITE[firefox - How to force Chrome to reload proxy configuration file? - Super User]]
([TIME[2017-08-25 17:39:56 +09:00]])
<https://superuser.com/questions/343445/how-to-force-chrome-to-reload-proxy-configuration-file>
[36] [CITE@en[85529 - PAC file handling seems to have regressed - chromium - Monorail]]
([TIME[2017-08-25 17:40:58 +09:00]])
<https://bugs.chromium.org/p/chromium/issues/detail?id=85529>
[37] [CITE@en[77847 - Use v8's isolates to implement ProxyResolverV8 - chromium - Monorail]]
([TIME[2017-08-25 17:41:20 +09:00]])
<https://bugs.chromium.org/p/chromium/issues/detail?id=77847>
[38] [CITE@en-US[Understanding Web Proxy Configuration – IEInternals]]
([TIME[2017-08-26 12:06:59 +09:00]])
<https://blogs.msdn.microsoft.com/ieinternals/2013/10/11/understanding-web-proxy-configuration/>
[FIG(quote)[
[FIGCAPTION[
[39] [CITE@en-US[Understanding Web Proxy Configuration – IEInternals]]
([TIME[2017-08-26 12:08:50 +09:00]])
<https://blogs.msdn.microsoft.com/ieinternals/2013/10/11/understanding-web-proxy-configuration/>
]FIGCAPTION]
> A problem arises if the server requests credentials using HTTP BASIC or HTTP DIGEST authentication, as these authentication methods require that the user respond to a credential prompt dialog box. (In contrast, NTLM and Negotiate authenticate silently).
> Many applications cannot handle showing prompts as a part of this workflow and will fail silently. To promote interoperability, IE11 also blocks the use of Proxy Configuration scripts that require authentication.
]FIG]
[40] [CITE[Proxy Client Autoconfig File Format]]
([TIME[2017-08-26 12:18:38 +09:00]])
<https://web.archive.org/web/20060424005037/wp.netscape.com/eng/mozilla/2.0/relnotes/demo/proxy-live.html>
[41] [CITE@en[IPv6-Aware Proxy Helper API Definitions (Windows)]]
([TIME[2017-08-26 12:19:13 +09:00]])
<https://msdn.microsoft.com/en-us/library/windows/desktop/gg308477(v=vs.85).aspx>
[42] [CITE@en[162721 - Support FindProxyForURLEx() in PAC scripts - chromium - Monorail]]
([TIME[2017-08-26 12:21:10 +09:00]])
<https://bugs.chromium.org/p/chromium/issues/detail?id=162721>
[43] [CITE@en[FindProxyForURLEx does not work in 1.3.5 · Issue #55 · pacparser/pacparser]]
([TIME[2017-08-26 12:21:29 +09:00]])
<https://github.com/pacparser/pacparser/issues/55>
[44] [CITE@en[pacparser/pacparser: A library to parse proxy auto-config (PAC) files]]
([TIME[2017-08-26 12:21:54 +09:00]])
<https://github.com/pacparser/pacparser>
[45] [CITE[Pacparser by pacparser]]
([TIME[2015-04-26 12:00:38 +09:00]])
<http://pacparser.manugarg.com/>
[46] [CITE@en[25407 - Support Internet Explorers PAC extensions - chromium - Monorail]]
([TIME[2017-08-26 12:23:43 +09:00]])
<https://bugs.chromium.org/p/chromium/issues/detail?id=25407>
[47] [CITE@en-US[Extensions to the Navigator Proxy Auto-Config File Format specification to support IPv6 v0.9 – Windows Core Networking]]
([TIME[2017-08-26 12:23:55 +09:00]])
<https://blogs.msdn.microsoft.com/wndp/2006/07/13/extensions-to-the-navigator-proxy-auto-config-file-format-specification-to-support-ipv6-v0-9/>
[48] [CITE@en[24641 - '''['''compatibility''']''' IPv6 addresses mess up proxy autoconfig scripts - chromium - Monorail]]
([TIME[2017-08-26 12:25:09 +09:00]])
<https://bugs.chromium.org/p/chromium/issues/detail?id=24641>
[49]
[[Chrome]] は [CODE[https:]] [[URL]] のとき [[path]] を含まない [[URL]]
を [[PAC]] に与えるらしい。