診断くんが Proxomitron を Proxy と判定する仕組み

診断くんは Proxomitron で [設定] -> [HTTP] タブ -> [ローカル接続の持続時間] にチェックを入れると、Proxy と判定する。
1
think49 @think49

ブラウザで Proxomitron をProxy設定している時、診断くん Ver 0.80a ( http://taruo.net/e/ ) が Proxy と判定する仕組みについて。

2010-10-24 23:23:02
think49 @think49

[ローカル接続の持続時間] にチェックを入れると、HTTPリクエストヘッダ Connection が取り除かれ、 はこれを 評価A のProxyと判定する。

2010-10-24 23:23:39
think49 @think49

[ローカル接続の持続時間] にチェックを外すと、"Connection: Keep-alive" となり、Proxyと見なさない。

2010-10-24 23:23:50
think49 @think49

Proxy判定のトリガーは Connection ヘッダフィールド (リクエストヘッダの一種) にある模様。

2010-10-24 23:24:12
think49 @think49

HTTP1.0 (RFC1945 / 4.3.1), HTTP1.1 (RFC2616 / 14.10) において、Proxyサーバは介在するProxyを超えて Connection ヘッダを転送してはならない。

2010-10-24 23:24:46
think49 @think49

そのため、Connectionヘッダが存在しなければ、Proxyを介している可能性がある。 ただし、Connectionヘッダはオプションであり、クライアントはConnectionヘッダを送信しないことも出来る。

2010-10-24 23:25:05
think49 @think49

診断くんは「Connectionヘッダが存在しない = Proxy を介している」と判定するが、これは「多くのブラウザが "Connection: Keep-Alive" を送信する」( http://goo.gl/Wkpc ) 現状を前提とした判定方法と思われる。

2010-10-24 23:26:52
think49 @think49

しかし、Connectionヘッダを送信しなかったクライアントの可能性もあるので、この判定方法はやや強引だと思う。

2010-10-24 23:27:07
think49 @think49

[RFC1945] HTTP/1.0 和訳版 ( http://goo.gl/liLB ) / [RFC2616] HTTP/1.1 和訳版 ( http://goo.gl/Fqdx )

2010-10-24 23:27:31
think49 @think49

@think49 * rfc2616-ja-HTTP1.1.txt は Google Chrome 6 で文字コード判定に失敗するので、手動で EUC-JP にセットする必要がある。

2010-10-24 23:28:28
think49 @think49

視点を変えてみると、[ローカル接続の持続時間] にチェックを入れた状態が HTTP1.0 および HTTP1.1 に準拠した動作といえなくもない。

2010-10-24 23:38:36
think49 @think49

Proxomitron Ver.Naoko 4.5 "June" の規定値は [ローカル接続の持続時間] (Cocal connections persist for) にチェックを入れており、"10" 秒に設定されている。

2010-11-08 19:50:36
think49 @think49

Proxomitron 設定の規定値は HTTP1.0 (RFC1945 / 4.3.1), HTTP1.1 (RFC2616 / 14.10) が推奨する動作に従っている。

2010-11-08 19:51:41
think49 @think49

"持続的接続は、クライアントとサーバが TCP 接続を閉じる時に合図を行えるというメカニズムを提供する。この合図は、Connection ヘッダフィールド (section 14.10) を用いて示す。" / HTTP1.1 (RFC2616 / 8.1.2 全体の動作)

2010-11-08 19:51:53
think49 @think49

"プロクシサーバは、HTTP/1.0 クライアントと HTTP/1.1 の持続的接続を確立し *てはならない* (MUST NOT)" / HTTP1.1 (RFC2616 / 8.1.3 プロクシサーバ)

2010-11-08 19:52:03
think49 @think49

"Connection 一般ヘッダフィールドは、送信者が特定の接続のために望むオプションを指定する事を可能にするが、介在するプロクシとの接続を超えて伝達し *てはならない*。(MUST NOT)" / HTTP1.1 (RFC2616 / 14.10 Connection)

2010-11-08 19:52:10
think49 @think49

HTTP1.1 における "MUST NOT" は RFC2119 ( http://goo.gl/c95wM ) に従う。

2010-11-08 19:52:18
think49 @think49

HTTP1.1 ではConnectionヘッダを転送することで持続的接続を確立するが、プロクシを超えてConnectionヘッダを転送してはならない (MUST NOT) とも規定されている。

2010-11-08 19:53:05
think49 @think49

HTTP1.1 に従うなら、Proxomitron の設定で [ローカル接続の持続時間] のチェックを外してはならない。(MUST NOT)

2010-11-08 19:53:15
think49 @think49

ProxN45j.zip の \Docs\Changes.txt には次のように書かれている。

2010-11-08 22:18:16
think49 @think49

"Local persistence can be turned off if necessary and it's keep-alive time adjusted under the HTTP tab of the Config dialog."

2010-11-08 22:18:38
think49 @think49

"By default local connections are killed after 10 seconds of inactivity."

2010-11-08 22:18:44
think49 @think49

"That should be fine in most cases since new local connections are fairly fast to create,"

2010-11-08 22:18:51
think49 @think49

"but you may wish to increase this - especially if you're using Proxomitron remotely over a LAN."

2010-11-08 22:18:57