<html xmlns="http://www.w3.org/1999/xhtml" a0:Name="SuikaWiki" xmlns:a0="urn:x-suika-fam-cx:markup:suikawiki:0:9:" a0:Version="0.9"><head></head><body><p><strong>HTTP/1.1 305 and 306 Response Codes</strong><ul><li>HTTP Working Group                                          </li><li>Internet-Draft                            </li><li>Josh Cohen</li><li>Netscape Communications Corp.</li><li>5 December 1996</li><li>&lt;draft-cohen-http-305-306-responses-00.txt&gt;</li></ul></p><section><h1>Status of this Memo</h1><blockquote><p>This document is an Internet-Draft.  Internet-Drafts are working
documents of the Internet Engineering Task Force (IETF), its areas,
and its working groups.  Note that other groups may also distribute
working documents as Internet-Drafts.</p><p>Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any
time.  It is inappropriate to use Internet- Drafts as reference
material or to cite them other than as ``work in progress.<em></em></p><p>To learn the current status of any Internet-Draft, please check the
``1id-abstracts.txt<em> listing contained in the Internet- Drafts
Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe),
munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or
ftp.isi.edu (US West Coast).</em></p></blockquote></section><section><h1>Abstract</h1><blockquote><p>The HTTP/1.1 RFC specifies a response code '305 Use Proxy' which is
intended to cause a client to retry the request using a specified
proxy server.  This functionality is important, but underspecified in
the current spec.  The spec does not specify for how long or which
URLs the redirect applies to, or how proxies can deal with or
generate similar responses.  This draft proposes a specification for
both the 305 response and a new response, &quot;306 Switch Proxy&quot;.</p></blockquote><p>HTTP/1.1 RFC は、クライアントに指定した串サーバーを使って要求を再試行させる目的の状態符号 <code class="HTTP">305 Use Proxy</code>
を規定しています。この機能は重要ですが、現行の仕様では規定されていません。
仕様はどれだけの期間どの URL について redirect を適用するのか、
あるいは串がどう処理することができるのか、同様の応答を生成することができるのかを規定していません。
この原案は <code class="HTTP">305</code> 応答及び新しい応答 <code class="HTTP">306 Switch Proxy</code>
の両者の仕様を提案します。</p></section><section><h1>Summary</h1><ol><li>1.0 Response Codes<ol><li>1.1 305 Use Proxy</li><li>1.2 306 Switch Proxy</li><li>1.3 506 Redirection Failed</li></ol></li><li>2.0 Headers<ol><li>2.1 Set-proxy:</li><li>2.2 Location:</li></ol></li><li>3.0 Methods<ol><li>3.1 OPTIONS</li></ol></li><li>4.0 Operational Constraints</li><li>5.0 Notes</li></ol></section><section><h1>1.0 Response Codes</h1><section><h1>1.1 305 Use Proxy</h1><blockquote><p>The 305 is generated by an origin server to indicate that the client,
or proxy, should use a proxy to access the requested resource.</p></blockquote><p><code class="HTTP"><a0:anchor>305</a0:anchor></code> は起源サーバーによってクライアント又は串に要求された資源に接続するのに串を使うべきであると支持するのに生成されます。</p><blockquote><p>The request SHOULD be accompanied by a 'Set-proxy' response header
indicating what proxy is to be used. The client will parse the 'Set-proxy' header as defined below to decide how long, for what URLs it
should use the specified proxy.</p></blockquote><p>要求にはどの串を使うかを示した <code class="HTTP">Set-proxy</code>
応答頭が伴う<strong>べきです</strong>。クライアントは <code class="HTTP">Set-proxy</code>
頭を後で定義するように解析してどれだけの間どの URL について指定されたくしを使うべきかを決定します。</p><blockquote><p>If the 305 response is not accompanied by a 'Set-proxy' header, it
MUST be accompanied by a 'Location' header.  The 'Location' header
will specify a URL to the proxy.</p></blockquote><p><code class="HTTP">305</code> 応答に <code class="HTTP">Set-proxy</code> 頭が伴わない場合は、
<code class="HTTP"><a0:anchor>Location</a0:anchor></code> 頭が伴わなければ<strong>なりません</strong>。
<code class="HTTP">Location</code> 頭は串の URL を指定します。</p><blockquote><p>If both headers are present in the response, the client SHOULD use
the 'Set-proxy' header only.</p></blockquote><p>応答で領頭とも示されている場合は、クライアントは <code class="HTTP">Set-proxy</code>
頭だけを使う<strong>べきです</strong>。</p></section><section><h1>1.2 306 Switch Proxy</h1><blockquote><p>The 306 response is generated by a proxy server to indicate that the
client or proxy should use the information in the accompanying 'Set-proxy' header to choose a proxy for subsequent requests.</p></blockquote><p><code class="HTTP"><a0:anchor>306</a0:anchor></code> 応答は串サーバーによって生成され、クライアント又は串は同伴の
<code class="HTTP">Set-proxy</code> 頭の情報を使って以降の要求で使う串を選択するべきであることを示します。</p><blockquote><p>The 306 response code MUST be accompanied by the 'Set-proxy' response
header.  The client or proxy will parse the 'Set-proxy' header to
determine which proxy to use, how long to use it, and for which URLs
to use it.</p></blockquote><p><code class="HTTP">306</code> 状態符号には <code class="HTTP">Set-proxy</code> 応答頭が伴わなければ<strong>なりません</strong>。
クライアント又は串は <code class="HTTP">Set-proxy</code> 頭を解析して、
どの串を使うか、どれだけの間その串を使うか、どの URL
についてその串を使うかを決定します。</p></section><section><h1>1.3 506 Redirection Failed</h1><blockquote><p>The 506 response is returned when a redirection fails or is refused
by a proxy or client.  If the redirection response included a body,
then it SHOULD be included in the 506 response.</p></blockquote><p><code class="HTTP"><a0:anchor>506</a0:anchor></code> 応答は、 redirect が失敗したか若しくは串又はクライアントにより拒まれた時に返されます。
Redirect 応答が本体を含む場合は、それは <code class="HTTP">506</code> 応答に含まれる<strong>べきです</strong>。</p></section></section><section><h1>2.0 Headers</h1><section><h1>2.1 'Set-proxy' Response Header</h1><blockquote><p>The 'Set-proxy' header is defined as:<pre>           Set-proxy: &quot;Set-proxy&quot; &quot;:&quot; 1(
                   action #(parameters)
                   )

           parameters = #( ( &quot;scope&quot; &quot;=&quot; scopePattern ) |
                   ( proxyURI &quot;=&quot; URI ) |
                   lifetime )

           lifetime = ( &quot;seconds&quot;  &quot;=&quot; integer )
                   | ( &quot;hits&quot;      &quot;=&quot; integer )

           action =  ( &quot;DIRECT&quot;
                   | &quot;IPL&quot;
                   | &quot;SET&quot; )
                   ) &quot;;&quot;

           scopePattern = &quot;*&quot; | &quot;-&quot; | URIpattern</pre></p><p>An example header:<pre>       Set-proxy: SET ; proxyURI = &quot;http://proxy.me.com:8080/&quot;,
           scope=&quot;http://&quot;, seconds=5</pre></p></blockquote><section><h1>action</h1><blockquote><p>The first item, &quot;action&quot; specifies the type or mode of the change.
Possible modes are:</p></blockquote><blockquote><dl><dt>DIRECT</dt><dd>Attempt to connect directly, with no proxy</dd></dl></blockquote><dl><dt><code class="HTTP">DIRECT</code></dt><dd>直接、串なしで接続しようとする</dd></dl><blockquote><dl><dt>IPL</dt><dd>
Initial Program Load, the client or proxy should attempt to revert
back to its default or initial proxy setting.  This is meant to
instruct a client to re-fetch its proxy configuration, or PAC file.
When set, the accompanying scope field MUST be &quot;*&quot; A client receiving this response SHOULD prompt the user for confirmation.</dd></dl></blockquote><dl><dt><code class="HTTP">IPL</code></dt><dd>初期プログラム読み込み, クライアント又は串はその既定又は初期串設定に戻ろうとするべきです。
これは、クライアントがその串設定又は PAC ファイルを再取得することを指示するのを意味します。
設定された時、同伴の <code class="HTTP">scope</code> 欄は <code class="HTTP">*</code>
でなければなりませんこの応答を受信したクライアントは利用者の確認を求める<strong>べきです</strong>。</dd></dl><blockquote><p>If accompanied by a 'proxyURI' parameter, a proxy or client MAY use
the value as a URL containing a configuration to retrieve.  If a
client  does so, it MUST prompt the user for confirmation.</p></blockquote><p><code class="HTTP">proxyURI</code> 引数が伴っているときは、串又はクライアントはその値を取り出すべき設定を含んだ
URL として使っても<strong>構いません</strong>。クライアントがそうするときは、
利用者に確認を求めなければ<strong>なりません</strong>。</p><blockquote><dl><dt>SET</dt><dd>
Set to parameter &quot;proxyURI&quot;.  The client should use the URL specified for &quot;proxyURI&quot; as the proxy.  If the SET mode is specified, the
parameter, &quot;proxyURI&quot;, MUST be present.</dd></dl></blockquote><dl><dt><code class="HTTP">SET</code></dt><dd>引数 <code class="HTTP">proxyURI</code> に設定。
クライアントは <code class="HTTP">proxyURI</code> に指定された URL 
を串として使うべきです。 <code class="HTTP">SET</code> モードが指定されている時は、
<code class="HTTP">proxyURI</code> 引数が示されていなければ<strong>なりません</strong>。</dd></dl></section><section><h1>Scope</h1><blockquote><p>Scope refers to a URI prefix pattern that specifies which URIs are
subject to this header setting.  URIs should be matched against the
scope with this rule :</p></blockquote><p><code class="HTTP">scope</code> はこの頭設定の対象となる URI を指定する URI
接頭辞パターンを示します。 <code class="HTTP">scope</code> の URI はこの規則で一致します:</p><blockquote><ul><li>The scope &quot;*&quot; means all requests</li><li>The scope &quot;-&quot; means this EXACT URL ONLY</li></ul></blockquote><ul><li>適用範囲 <code class="HTTP">*</code> は全ての要求を意味する</li><li>適用範囲 <code class="HTTP">-</code> は<strong>正確にこの URL のみ</strong>を意味する</li></ul><blockquote><p>Otherwise, the URL is compared with the scope after it is:</p></blockquote><p>それ以外では、 URL は</p><blockquote><ul><li>truncated to the length of the scope</li><li>domain names are set in reverse order.</li></ul></blockquote><ul><li><code class="HTTP">scope</code> の長さに切って、</li><li>ドメイン名を逆順に設定</li></ul><p>した後に <code class="HTTP">scope</code> と比較します。</p><blockquote><p>For example:<ul><li>scope = &quot;http://com.foo.www/services/&quot;</li><li>URL &quot;http://www.foo.com/services/express/2day.html&quot;</li><li>transformed: &quot;http://com.foo.www/services/express/&quot; (MATCH)</li></ul></p></blockquote><blockquote><p>Another example:<ul><li>scope = &quot;http://com.ups/&quot;      URL &quot;http://www.ups.com/&quot;  (MATCH)</li><li>URL &quot;http://www.fedex.com/&quot; (FAIL)</li></ul></p></blockquote><blockquote><p>The lifetime parameter specifies how long the specified proxy
should be used.  If lifetime is specified as &quot;seconds&quot; then the
proxy setting remains in effect for 'integer' seconds.  If lifetime
is specified in 'hits' then the proxy setting remains in effect for
'integer' transactions.</p></blockquote><p><code class="ABNF">lifetime</code> 引数はどれだけの間指定された串を使うべきかを指定します。
生存時間が <code class="HTTP">second</code> で指定されていれば、串設定は <code class="ABNF">integer</code>
秒間有効です。生存時間が <code class="HTTP">hits</code> で指定されていれば
<code class="ABNF">integer</code> 回の取引の間有効です。</p></section></section><section><h1>2.2 Location Header</h1><blockquote><p>In the original HTTP/1.1 spec, the 'Location' header was used to
indicate the proxy setting.  Its use is DEPRECATED by the 'Set-proxy' header in the context of a 305 response. All new implementations MUST send the Set-proxy header.  Implementations MAY send the
'Location' header so as to allow backward compatibility.</p></blockquote><p>元の HTTP/1.1 仕様では、 <code class="HTTP">Location</code> 頭を使って串設定を示していました。
この用法は <code class="HTTP">Set-proxy</code> 頭があるので <code class="HTTP">305</code>
応答の文脈では<strong>非推奨</strong>とします。すべての新しい実装は <code class="HTTP">Set-proxy</code>
頭を送らなければ<strong>なりません</strong>。
実装は後方互換性のために <code class="HTTP">Location</code> 頭を送っても<strong>構いません</strong>。</p><blockquote><p>If the 'Location' header is specified, it should contain a URI of
the proxy.  If the Set-proxy header is not specified, the client
should use this proxy for just one request, and only for the originally requested exact URL.</p></blockquote><p><code class="HTTP">Location</code> 頭が指定される時は、串の URI
を含むべきです。 <code class="HTTP">Set-proxy</code> 頭が指定されていないときは、
クライアントはこの串をただ1回の要求だけ、そして元の要求したその URL
にだけ使用するべきです。</p></section></section><section><h1>3.0 Methods</h1><blockquote><p>A client or proxy receiving a 305 or 306, should use the OPTIONS
method to determine if the server or proxy it is talking to actually is an HTTP/1.1 server supporting 305 and 306 responses.</p></blockquote><p><code class="HTTP">305</code> 又は <code class="HTTP">306</code> を受信したクライアント又は串は、
その話しているサーバー又は串が実際に <code class="HTTP">305</code> 又は <code class="HTTP">306</code>
の応答に対応していた HTTP/1.1 サーバーであるかを決定するのに <code class="HTTP"><a0:anchor>OPTIONS</a0:anchor></code> method
を使うべきです。</p></section><section><h1>4.0 Operational Constraints <ins>操作上の制約</ins></h1><blockquote><ul><li>Both the 305 and 306 response codes are HOP by HOP.  A proxy server
MUST not forward a 305 or 306 respose code (unless it generated the 306).</li><li>A webserver MUST NOT send a 306 response under any circumstances</li><li>A proxy server MUST NOT generate a 305 response.</li><li>A client or proxy SHOULD NOT accept a 306 from a proxy that it
learned of via a 305 response code.</li><li>A client or proxy MAY maintain state and allow a lifetime to extend
beyond a session or restart.</li><li>A 'Set-proxy: IPL' SHOULD override any previous 'Set-proxy' header.</li><li>A 305 or 306 response MAY contain a body containing an explanation
of the redirect for clients which do not understand the redirect</li><li>In the absence of any parameter, the following defaults should be used:<ul><li>lifetime = this transaction only</li><li>scope = this exact URL only</li></ul></li></ul></blockquote><ul><li>応答符号 <code class="HTTP">305</code> も <code class="HTTP">306</code> も、 HOP by HOP です。
串サーバーは <code class="HTTP">305</code> と <code class="HTTP">306</code> のどちらの応答符号も
(その串が <code class="HTTP">306</code> を生成するのでない限りは)
転送しては<strong>なりま</strong>せん。</li><li>Web サーバーはいかなる状況下でも <code class="HTTP">306</code> 応答を送信しては<strong>なりません</strong>。</li><li>串サーバーは <code class="HTTP">305</code> 応答を生成してはなりません。</li><li>クライアント又は串は <code class="HTTP">305</code> 応答符号を介して知った串からの
<code class="HTTP">306</code> を受け入れる<strong>べきではありません</strong>。</li><li>クライアント又は串は腐りを維持し、生存時間がセッションや再起動を越えることを認めても<strong>構いません</strong>。</li><li><code class="HTTP">Set-proxy: IPL</code> はそれ以前の全ての <code class="HTTP">Set-proxy</code> 頭を上書きする<strong>べきです</strong>。</li><li><code class="HTTP">305</code> 応答又は <code class="HTTP">306</code> 応答は、 redirect
を理解しないクライアントに対しての redirect の説明を含んだ本体を含んでも<strong>構いません</strong>。</li><li>どの引数も存在しないときは、次の既定値を使うべきです。<ul><li>lifetime = このやり取りのみ</li><li>scope = この URL だけ</li></ul></li></ul><blockquote><ul><li>When receiving a 305 response, the client or proxy will enforce the
following rule with respect to the scope.</li></ul></blockquote><ul><li><code class="HTTP">305</code> 応答を受信した時は、クライアント又は串は
<code class="HTTP">scope</code> に従う次の規則を適用します。</li></ul><blockquote><p>The scope specified must be more restrictive than the transformed
URL in question.</p></blockquote><p>指定された適用範囲は対象の変形 URL より制限的なものでなければなりません。</p><blockquote><p>Example: (in order of restrictiveness)<ol><li>http://com.ups.www/services/express/1day.html ( most restrictive)</li><li>http://com.ups.www/ (all requests for only www.ups.com )</li><li>http://com.ups ( all requests for ups.com )</li><li>http://  ( for all http requests )</li><li>*  ( all requests )</li></ol></p></blockquote><p>例 (制限的である順)<ol><li>http://com.ups.www/services/express/1day.html (最も制限的)</li><li>http://com.ups.www/ (<code>www.ups.com</code> だけについて、全ての要求)</li><li>http://com.ups ([CODE{ups.com]] に対する全ての要求)</li><li>http://  (全ての HTTP 要求)</li><li>*  (全ての要求)</li></ol></p><blockquote><p>If the scope returned with a 305 response is less restrictive than
the requested URL, the client MUST prompt the user for confirmation
before accepting the new proxy setting.</p></blockquote><p><code class="HTTP">305</code> 応答で返された適用範囲が要求 URL
より制限的でないなら、クライアントは新しい串設定を受け入れる前に利用者に確認を取らなければ<strong>なりません</strong>。</p><blockquote><ul><li>Since HTTP/1.0 proxies may unknowingly forward a 305 or 306
response code that was generated maliciously or in good faith, the
client must attempt to ascertain if the proxy with which it is
directly communicating is HTTP/1.1 and if it supports the 'Set-proxy' header.  To determine this, the client or proxy should use
the OPTIONS method to make a request check for this feature.</li></ul></blockquote><ul><li>HTTP/1.0 串は悪意を持ってであれ誠意であれ生成された <code class="HTTP">305</code>
又は <code class="HTTP">306</code> の状態符号を未知ゆえに転送するかもしれないので、
クライアントはその直接通信している串が HTTP/1.1
であるか、 <code class="HTTP">Set-proxy</code> 頭に対応しているかを確認しようと試みなければなりません。
これを決定するために、クライアント又は串はこの機能を確認する要求を行うのに
<code class="HTTP">OPTIONS</code> method を使うべきです。</li></ul></section><section><h1>Security Considerations</h1><blockquote><p>Great care should be taken when implementing client side actions
based on the 305 or 306.  Since older proxies may unknowingly forward either of these reponses, clients should be prepared to check the validity.</p></blockquote><p><code class="HTTP">305</code> 又は <code class="HTTP">306</code> に基づくクライアント側の動作を実装する時には多大な注意を払うべきです。
古い串は未知ゆえにこれらの応答を転送するかもしれませんから、
クライアントは妥当性を確認する準備をするべきです。</p><blockquote><ul><li>Please read the section 'Operational Constraints'</li><li>A client or proxy MUST NOT accept a 305 response from a proxy.</li><li>A client or proxy MUST NOT accept a 306 response from an origin  server.</li><li>When receiving a 306 response from a proxy, the client MUST verify
that the proxy supports the 306 response with a METHODS request.</li></ul></blockquote><ul><li>「操作上の制約」の節を読んで下さい</li><li>クライアント又は串は串からの <code class="HTTP">305</code> 要求を受け入れては<strong>なりません</strong>。</li><li>クライアント又は起源サーバーからの <code class="HTTP">306</code> 要求を受け入れては<strong>なりません</strong>。</li><li>串から <code class="HTTP">306</code> 応答を受信したときは、
クライアントはその串が <code class="HTTP">306</code> 応答に対応しているかを
<code class="HTTP">METHODS</code> 要求で検査しなければ<strong>なりません</strong>。</li></ul></section><section><h1>5.0 Notes</h1><blockquote><p>Further specification is needed to define exactly how to use
METHODs, or another mechanism to determin if set-proxy is supported.</p></blockquote><p>どう <code class="HTTP">METHOD</code> を使うかをちゃんと定義する更なる仕様書か、
set-proxy に対応しているかを決定する他の機構が必要。</p></section><section><h1>Author's Address</h1><pre>     Josh Cohen
     Netscape Communications Corporation
     501 E. Middlefield Rd
     Mountain View, CA 94043

     Phone (415) 937-4157
     EMail: josh@netscape.com</pre></section><section><h1>License</h1><p><a0:anchor>RFCのライセンス</a0:anchor></p></section><section><h1>メモ</h1></section></body></html>