SandBox

HTTP server

A connection endpoint has:

read timer
A timer, initially unset.

When a connection has been established, or whene a connection has received some data, set connection's read timer to 60s.

When connection's read timer's current time becomes 0, close the connection endpoint.

  1. 改行を読み飛ばします。
  2. 要求行を、要求行を構文解析した結果に設定します。
  3. 要求行がエラーなら、
    1. 致死的エラーとし、ここで停止します。
  4. 要求行プロトコルの版null なら、
    1. 応答プロトコルの版を、 HTTP/0.9 に設定します。
    2. 要求行要求メソッドGET 以外なら、
      1. 致死的エラーとし、ここで停止します。
  5. それ以外の場合、
    1. 要求行要求メソッド
    2. 要求ヘッダー
  6. 要求行要求対象
  7. 要求本体
[2] 改行とは

[1] 致死的エラーでは、次のようにします。

  1. 400 応答本体を送信します。
  2. Close the connection endpoint.

To close the connection endpoint:

  1. Let endpoint's connection be closed.

[3] 要求行を構文解析とは

  1. 要求対象の先頭が / でなければ、エラーを返します。

CONNECT hoge HTTP/1.1
CONNECT mode
WS mode