#?SuikaWiki/0.9 '''HTTP/1.1 305 and 306 Response Codes''' -HTTP Working Group -Internet-Draft - Josh Cohen - Netscape Communications Corp. - 5 December 1996 - *Status of this Memo > 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. > 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.'' > To learn the current status of any Internet-Draft, please check the ``1id-abstracts.txt'' 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). *Abstract > 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, "306 Switch Proxy". HTTP/1.1 RFC は、クライアントに指定した串サーバーを使って要求を再試行させる目的の状態符号 [CODE(HTTP)[305 Use Proxy]] を規定しています。この機能は重要ですが、現行の仕様では規定されていません。 仕様はどれだけの期間どの URL について redirect を適用するのか、 あるいは串がどう処理することができるのか、同様の応答を生成することができるのかを規定していません。 この原案は [CODE(HTTP)[305]] 応答及び新しい応答 [CODE(HTTP)[306 Switch Proxy]] の両者の仕様を提案します。 *Summary =1.0 Response Codes ==1.1 305 Use Proxy ==1.2 306 Switch Proxy ==1.3 506 Redirection Failed =2.0 Headers ==2.1 Set-proxy: ==2.2 Location: =3.0 Methods ==3.1 OPTIONS =4.0 Operational Constraints =5.0 Notes *1.0 Response Codes **1.1 305 Use Proxy > The 305 is generated by an origin server to indicate that the client, or proxy, should use a proxy to access the requested resource. [CODE(HTTP)[[[305]]]] は起源サーバーによってクライアント又は串に要求された資源に接続するのに串を使うべきであると支持するのに生成されます。 > 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. 要求にはどの串を使うかを示した [CODE(HTTP)[Set-proxy]] 応答頭が伴う'''べきです'''。クライアントは [CODE(HTTP)[Set-proxy]] 頭を後で定義するように解析してどれだけの間どの URL について指定されたくしを使うべきかを決定します。 > 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. [CODE(HTTP)[305]] 応答に [CODE(HTTP)[Set-proxy]] 頭が伴わない場合は、 [CODE(HTTP)[[[Location]]]] 頭が伴わなければ'''なりません'''。 [CODE(HTTP)[Location]] 頭は串の URL を指定します。 >If both headers are present in the response, the client SHOULD use the 'Set-proxy' header only. 応答で領頭とも示されている場合は、クライアントは [CODE(HTTP)[Set-proxy]] 頭だけを使う'''べきです'''。 **1.2 306 Switch Proxy > 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. [CODE(HTTP)[[[306]]]] 応答は串サーバーによって生成され、クライアント又は串は同伴の [CODE(HTTP)[Set-proxy]] 頭の情報を使って以降の要求で使う串を選択するべきであることを示します。 > 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. [CODE(HTTP)[306]] 状態符号には [CODE(HTTP)[Set-proxy]] 応答頭が伴わなければ'''なりません'''。 クライアント又は串は [CODE(HTTP)[Set-proxy]] 頭を解析して、 どの串を使うか、どれだけの間その串を使うか、どの URL についてその串を使うかを決定します。 **1.3 506 Redirection Failed > 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. [CODE(HTTP)[[[506]]]] 応答は、 redirect が失敗したか若しくは串又はクライアントにより拒まれた時に返されます。 Redirect 応答が本体を含む場合は、それは [CODE(HTTP)[506]] 応答に含まれる'''べきです'''。 *2.0 Headers **2.1 'Set-proxy' Response Header > The 'Set-proxy' header is defined as: [PRE[ Set-proxy: "Set-proxy" ":" 1( action #(parameters) ) parameters = #( ( "scope" "=" scopePattern ) | ( proxyURI "=" URI ) | lifetime ) lifetime = ( "seconds" "=" integer ) | ( "hits" "=" integer ) action = ( "DIRECT" | "IPL" | "SET" ) ) ";" scopePattern = "*" | "-" | URIpattern ]PRE] > An example header: [PRE[ Set-proxy: SET ; proxyURI = "http://proxy.me.com:8080/", scope="http://", seconds=5 ]PRE] ***action > The first item, "action" specifies the type or mode of the change. Possible modes are: > :DIRECT:Attempt to connect directly, with no proxy :[CODE(HTTP)[DIRECT]]:直接、串なしで接続しようとする > :IPL: 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 "*" A client receiving this response SHOULD prompt the user for confirmation. :[CODE(HTTP)[IPL]]:初期プログラム読み込み, クライアント又は串はその既定又は初期串設定に戻ろうとするべきです。 これは、クライアントがその串設定又は PAC ファイルを再取得することを指示するのを意味します。 設定された時、同伴の [CODE(HTTP)[scope]] 欄は [CODE(HTTP)[*]] でなければなりませんこの応答を受信したクライアントは利用者の確認を求める'''べきです'''。 >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. [CODE(HTTP)[proxyURI]] 引数が伴っているときは、串又はクライアントはその値を取り出すべき設定を含んだ URL として使っても'''構いません'''。クライアントがそうするときは、 利用者に確認を求めなければ'''なりません'''。 > :SET: Set to parameter "proxyURI". The client should use the URL specified for "proxyURI" as the proxy. If the SET mode is specified, the parameter, "proxyURI", MUST be present. :[CODE(HTTP)[SET]]:引数 [CODE(HTTP)[proxyURI]] に設定。 クライアントは [CODE(HTTP)[proxyURI]] に指定された URL を串として使うべきです。 [CODE(HTTP)[SET]] モードが指定されている時は、 [CODE(HTTP)[proxyURI]] 引数が示されていなければ'''なりません'''。 ***Scope > 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 : [CODE(HTTP)[scope]] はこの頭設定の対象となる URI を指定する URI 接頭辞パターンを示します。 [CODE(HTTP)[scope]] の URI はこの規則で一致します: > - The scope "*" means all requests - The scope "-" means this EXACT URL ONLY - 適用範囲 [CODE(HTTP)[*]] は全ての要求を意味する - 適用範囲 [CODE(HTTP)[-]] は'''正確にこの URL のみ'''を意味する > Otherwise, the URL is compared with the scope after it is: それ以外では、 URL は > - truncated to the length of the scope - domain names are set in reverse order. - [CODE(HTTP)[scope]] の長さに切って、 - ドメイン名を逆順に設定 した後に [CODE(HTTP)[scope]] と比較します。 > For example: - scope = "http://com.foo.www/services/" - URL "http://www.foo.com/services/express/2day.html" - transformed: "http://com.foo.www/services/express/" (MATCH) > Another example: - scope = "http://com.ups/" URL "http://www.ups.com/" (MATCH) - URL "http://www.fedex.com/" (FAIL) > The lifetime parameter specifies how long the specified proxy should be used. If lifetime is specified as "seconds" 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. [CODE(ABNF)[lifetime]] 引数はどれだけの間指定された串を使うべきかを指定します。 生存時間が [CODE(HTTP)[second]] で指定されていれば、串設定は [CODE(ABNF)[integer]] 秒間有効です。生存時間が [CODE(HTTP)[hits]] で指定されていれば [CODE(ABNF)[integer]] 回の取引の間有効です。 **2.2 Location Header > 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. 元の HTTP/1.1 仕様では、 [CODE(HTTP)[Location]] 頭を使って串設定を示していました。 この用法は [CODE(HTTP)[Set-proxy]] 頭があるので [CODE(HTTP)[305]] 応答の文脈では'''非推奨'''とします。すべての新しい実装は [CODE(HTTP)[Set-proxy]] 頭を送らなければ'''なりません'''。 実装は後方互換性のために [CODE(HTTP)[Location]] 頭を送っても'''構いません'''。 > 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. [CODE(HTTP)[Location]] 頭が指定される時は、串の URI を含むべきです。 [CODE(HTTP)[Set-proxy]] 頭が指定されていないときは、 クライアントはこの串をただ1回の要求だけ、そして元の要求したその URL にだけ使用するべきです。 *3.0 Methods > 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. [CODE(HTTP)[305]] 又は [CODE(HTTP)[306]] を受信したクライアント又は串は、 その話しているサーバー又は串が実際に [CODE(HTTP)[305]] 又は [CODE(HTTP)[306]] の応答に対応していた HTTP/1.1 サーバーであるかを決定するのに [CODE(HTTP)[[[OPTIONS]]]] method を使うべきです。 *4.0 Operational Constraints [INS[操作上の制約]] > - 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). -A webserver MUST NOT send a 306 response under any circumstances - A proxy server MUST NOT generate a 305 response. - A client or proxy SHOULD NOT accept a 306 from a proxy that it learned of via a 305 response code. - A client or proxy MAY maintain state and allow a lifetime to extend beyond a session or restart. - A 'Set-proxy: IPL' SHOULD override any previous 'Set-proxy' header. - A 305 or 306 response MAY contain a body containing an explanation of the redirect for clients which do not understand the redirect - In the absence of any parameter, the following defaults should be used: -- lifetime = this transaction only -- scope = this exact URL only - 応答符号 [CODE(HTTP)[305]] も [CODE(HTTP)[306]] も、 HOP by HOP です。 串サーバーは [CODE(HTTP)[305]] と [CODE(HTTP)[306]] のどちらの応答符号も (その串が [CODE(HTTP)[306]] を生成するのでない限りは) 転送しては'''なりま'''せん。 - Web サーバーはいかなる状況下でも [CODE(HTTP)[306]] 応答を送信しては'''なりません'''。 - 串サーバーは [CODE(HTTP)[305]] 応答を生成してはなりません。 - クライアント又は串は [CODE(HTTP)[305]] 応答符号を介して知った串からの [CODE(HTTP)[306]] を受け入れる'''べきではありません'''。 - クライアント又は串は腐りを維持し、生存時間がセッションや再起動を越えることを認めても'''構いません'''。 - [CODE(HTTP)[Set-proxy: IPL]] はそれ以前の全ての [CODE(HTTP)[Set-proxy]] 頭を上書きする'''べきです'''。 - [CODE(HTTP)[305]] 応答又は [CODE(HTTP)[306]] 応答は、 redirect を理解しないクライアントに対しての redirect の説明を含んだ本体を含んでも'''構いません'''。 - どの引数も存在しないときは、次の既定値を使うべきです。 -- lifetime = このやり取りのみ -- scope = この URL だけ > - When receiving a 305 response, the client or proxy will enforce the following rule with respect to the scope. - [CODE(HTTP)[305]] 応答を受信した時は、クライアント又は串は [CODE(HTTP)[scope]] に従う次の規則を適用します。 >The scope specified must be more restrictive than the transformed URL in question. 指定された適用範囲は対象の変形 URL より制限的なものでなければなりません。 > Example: (in order of restrictiveness) = http://com.ups.www/services/express/1day.html ( most restrictive) = http://com.ups.www/ (all requests for only www.ups.com ) = http://com.ups ( all requests for ups.com ) = http:// ( for all http requests ) = * ( all requests ) 例 (制限的である順) = http://com.ups.www/services/express/1day.html (最も制限的) = http://com.ups.www/ ([CODE[www.ups.com]] だけについて、全ての要求) = http://com.ups ([CODE{ups.com]] に対する全ての要求) = http:// (全ての HTTP 要求) = * (全ての要求) > 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. [CODE(HTTP)[305]] 応答で返された適用範囲が要求 URL より制限的でないなら、クライアントは新しい串設定を受け入れる前に利用者に確認を取らなければ'''なりません'''。 > - 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. - HTTP/1.0 串は悪意を持ってであれ誠意であれ生成された [CODE(HTTP)[305]] 又は [CODE(HTTP)[306]] の状態符号を未知ゆえに転送するかもしれないので、 クライアントはその直接通信している串が HTTP/1.1 であるか、 [CODE(HTTP)[Set-proxy]] 頭に対応しているかを確認しようと試みなければなりません。 これを決定するために、クライアント又は串はこの機能を確認する要求を行うのに [CODE(HTTP)[OPTIONS]] method を使うべきです。 *Security Considerations > 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. [CODE(HTTP)[305]] 又は [CODE(HTTP)[306]] に基づくクライアント側の動作を実装する時には多大な注意を払うべきです。 古い串は未知ゆえにこれらの応答を転送するかもしれませんから、 クライアントは妥当性を確認する準備をするべきです。 > - Please read the section 'Operational Constraints' - A client or proxy MUST NOT accept a 305 response from a proxy. - A client or proxy MUST NOT accept a 306 response from an origin server. - When receiving a 306 response from a proxy, the client MUST verify that the proxy supports the 306 response with a METHODS request. - 「操作上の制約」の節を読んで下さい - クライアント又は串は串からの [CODE(HTTP)[305]] 要求を受け入れては'''なりません'''。 - クライアント又は起源サーバーからの [CODE(HTTP)[306]] 要求を受け入れては'''なりません'''。 - 串から [CODE(HTTP)[306]] 応答を受信したときは、 クライアントはその串が [CODE(HTTP)[306]] 応答に対応しているかを [CODE(HTTP)[METHODS]] 要求で検査しなければ'''なりません'''。 *5.0 Notes > Further specification is needed to define exactly how to use METHODs, or another mechanism to determin if set-proxy is supported. どう [CODE(HTTP)[METHOD]] を使うかをちゃんと定義する更なる仕様書か、 set-proxy に対応しているかを決定する他の機構が必要。 *Author's Address [PRE[ Josh Cohen Netscape Communications Corporation 501 E. Middlefield Rd Mountain View, CA 94043 Phone (415) 937-4157 EMail: josh@netscape.com ]PRE] * License [[RFCのライセンス]] * メモ