小学生でも分かるプロキシ講座(3')
小学生でも分かるプロキシ講座(1)「delegate」というモノの役割は前回書いたとおりです。
小学生でも分かるプロキシ講座(2)
小学生でも分かるプロキシ講座(3)
- 自分が受け取ったリクエストの一部と宛先を改変し送信する
- 自分が受け取ったレスポンスを「自分にリクエストを送ってきた相手」に送信する
このメカニズムさえ分かっていれば「delegateによる『多段串』の実体」というのも理解できるはずです。ですが、まぁ頭の中で考えるのも面倒なので一応書いておきます。特に新しい内容ではないです。前回小学生でも分かるプロキシ講座(3)で書いたとおりの「改変」が行われていることを確認して下さい。
|
□リクエスト1: クライアント → Delegate1 |
|
GET -_-http://Delegate2/-_-http://WebServer/File HTTP/1.1 Accept: */* User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) Host: Delegate1 |
|
大意: お前のとこの「-_-http://Delegate2/-_-http://WebServer/File」をよこせ |
- 宛先を「Delegate2」にする
- GET内の「-_-http://Delegate2/」を除去する
- Hostを「Delegate2」にする
|
□リクエスト2: Delegate1 → Delegate2 |
|
GET -_-http://WebServer/File HTTP/1.1 Accept: */* User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) Host: Delegate2 |
|
大意: お前のとこの「-_-http://WebServer/File」をよこせ |
- 宛先を「WebServer」にする
- GET内の「-_-http://WebServer/」を除去する
- Hostを「WebServer」にする
|
□リクエスト3: Delegate2 → WebServer |
|
GET /File HTTP/1.1 Accept: */* User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) Host: WebServer |
|
大意: お前のとこの「File」をよこせ |
|
□レスポンス1: WebServer → Delegate2 |
|
HTTP/1.1 200 OK Date: Wed, 25 Dec 2002 09:00:00 GMT Server: Apache/1.3.9 (Unix) Content-Type: text/html <html lang="ja"> <head> <meta http-equiv="content-type" content="text/html;charset=SHIFT_JIS"> (以下省略) |
|
□レスポンス2: Delegate2 → Delegate1 |
|
HTTP/1.1 200 OK Date: Wed, 25 Dec 2002 09:00:00 GMT Server: Apache/1.3.9 (Unix) Content-Type: text/html <html lang="ja"> <head> <meta http-equiv="content-type" content="text/html;charset=SHIFT_JIS"> (以下省略) |
|
□レスポンス3: Delegate1 → クライアント |
|
HTTP/1.1 200 OK Date: Wed, 25 Dec 2002 09:00:00 GMT Server: Apache/1.3.9 (Unix) Content-Type: text/html <html lang="ja"> <head> <meta http-equiv="content-type" content="text/html;charset=SHIFT_JIS"> (以下省略) |
小学生でも分かるプロキシ講座(4)
小学生でも分かるプロキシ講座(5)
小学生でも分かるプロキシ講座(6)

TrackBack
この記事へのトラックバック