/
50.txt
155 lines (105 loc) · 6.71 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
* 文脈
[26] 組織内ネットワークなどで管理者が提供していることがよくあります。
[[プロキシ]]の設定を管理者側で一括管理できるので便利です。
[27] [[WPAD]] により [[PAC]] の [[URL]] 自体を配布することもできます。
* 処理
[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]] の場合の入力 [[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>