node.jsでHello World Webサーバーを動かした時のオブジェクトリスト

node.jsのドキュメントの一番最初のスクリプトHello World Webサーバーを動かした時の関連オブジェクトをconsole.logしてみる。(test on v0.6.18)

これ
http://nodejs.jp/nodejs.org_ja/docs/v0.6/api/synopsis.html
で、こうしてみる。

```
var http = require('http');

var sv1 = http.createServer(function (request, response) {
  response.writeHead(200, {'Content-Type': 'text/plain'});
  response.end('Hello World\n');

  console.log('http-----------------------------------');
  console.log(http);
  console.log('request-----------------------------------');
  console.log(request);
  console.log('response-----------------------------------');
  console.log(response);


}).listen(8124);

console.log('Server running at http://127.0.0.1:8124/');
```

とこうなる

```
$ node test.js

Server running at http://127.0.0.1:8124/

http-----------------------------------
{ parsers: { name: 'parsers', constructor: [Function], max: 1000, list: [] },
  STATUS_CODES: 
   { '100': 'Continue',
     '101': 'Switching Protocols',
     '102': 'Processing',
     '200': 'OK',
     '201': 'Created',
     '202': 'Accepted',
     '203': 'Non-Authoritative Information',
     '204': 'No Content',
     '205': 'Reset Content',
     '206': 'Partial Content',
     '207': 'Multi-Status',
     '300': 'Multiple Choices',
     '301': 'Moved Permanently',
     '302': 'Moved Temporarily',
     '303': 'See Other',
     '304': 'Not Modified',
     '305': 'Use Proxy',
     '307': 'Temporary Redirect',
     '400': 'Bad Request',
     '401': 'Unauthorized',
     '402': 'Payment Required',
     '403': 'Forbidden',
     '404': 'Not Found',
     '405': 'Method Not Allowed',
     '406': 'Not Acceptable',
     '407': 'Proxy Authentication Required',
     '408': 'Request Time-out',
     '409': 'Conflict',
     '410': 'Gone',
     '411': 'Length Required',
     '412': 'Precondition Failed',
     '413': 'Request Entity Too Large',
     '414': 'Request-URI Too Large',
     '415': 'Unsupported Media Type',
     '416': 'Requested Range Not Satisfiable',
     '417': 'Expectation Failed',
     '418': 'I\'m a teapot',
     '422': 'Unprocessable Entity',
     '423': 'Locked',
     '424': 'Failed Dependency',
     '425': 'Unordered Collection',
     '426': 'Upgrade Required',
     '500': 'Internal Server Error',
     '501': 'Not Implemented',
     '502': 'Bad Gateway',
     '503': 'Service Unavailable',
     '504': 'Gateway Time-out',
     '505': 'HTTP Version not supported',
     '506': 'Variant Also Negotiates',
     '507': 'Insufficient Storage',
     '509': 'Bandwidth Limit Exceeded',
     '510': 'Not Extended' },
  IncomingMessage: 
   { [Function: IncomingMessage]
     super_: { [Function: Stream] super_: [Function: EventEmitter], Stream: [Circular] } },
  OutgoingMessage: 
   { [Function: OutgoingMessage]
     super_: { [Function: Stream] super_: [Function: EventEmitter], Stream: [Circular] } },
  ServerResponse: { [Function: ServerResponse] super_: { [Function: OutgoingMessage] super_: [Object] } },
  Agent: { [Function: Agent] super_: [Function: EventEmitter], defaultMaxSockets: 5 },
  globalAgent: 
   { options: {},
     requests: {},
     sockets: {},
     maxSockets: 5,
     _events: { free: [Function] },
     createConnection: [Function] },
  ClientRequest: { [Function: ClientRequest] super_: { [Function: OutgoingMessage] super_: [Object] } },
  request: [Function],
  get: [Function],
  Server: 
   { [Function: Server]
     super_: { [Function: Server] super_: [Function: EventEmitter] } },
  createServer: [Function],
  _connectionListener: [Function: connectionListener],
  Client: { [Function: Client] super_: [Function: EventEmitter] },
  createClient: [Function] 
}

request-----------------------------------
{ socket: 
   { _handle: 
      { writeQueueSize: 0,
        socket: [Circular],
        onread: [Function: onread] },
     _pendingWriteReqs: 1,
     _flags: 0,
     _connectQueueSize: 0,
     destroyed: false,
     errorEmitted: false,
     bytesRead: 552,
     bytesWritten: 119,
     allowHalfOpen: true,
     writable: true,
     readable: true,
     server: 
      { connections: 2,
        allowHalfOpen: true,
        _handle: [Object],
        _events: [Object],
        httpAllowHalfOpen: false },
     ondrain: [Function],
     _idleTimeout: 120000,
     _idleNext: 
      { _handle: [Object],
        _pendingWriteReqs: 0,
        _flags: 0,
        _connectQueueSize: 0,
        destroyed: false,
        errorEmitted: false,
        bytesRead: 0,
        bytesWritten: 0,
        allowHalfOpen: true,
        writable: true,
        readable: true,
        server: [Object],
        ondrain: [Function],
        _idleTimeout: 120000,
        _idleNext: [Object],
        _idlePrev: [Circular],
        _idleStart: Thu, 19 Jul 2012 05:56:49 GMT,
        _events: [Object],
        ondata: [Function],
        onend: [Function] },
     _idlePrev: 
      { _idleNext: [Circular],
        _idlePrev: [Object],
        ontimeout: [Function] },
     _idleStart: Thu, 19 Jul 2012 05:56:49 GMT,
     _events: { timeout: [Object], error: [Function], close: [Object] },
     ondata: [Function],
     onend: [Function],
     _httpMessage: null },
  connection: 
   { _handle: 
      { writeQueueSize: 0,
        socket: [Circular],
        onread: [Function: onread] },
     _pendingWriteReqs: 1,
     _flags: 0,
     _connectQueueSize: 0,
     destroyed: false,
     errorEmitted: false,
     bytesRead: 552,
     bytesWritten: 119,
     allowHalfOpen: true,
     writable: true,
     readable: true,
     server: 
      { connections: 2,
        allowHalfOpen: true,
        _handle: [Object],
        _events: [Object],
        httpAllowHalfOpen: false },
     ondrain: [Function],
     _idleTimeout: 120000,
     _idleNext: 
      { _handle: [Object],
        _pendingWriteReqs: 0,
        _flags: 0,
        _connectQueueSize: 0,
        destroyed: false,
        errorEmitted: false,
        bytesRead: 0,
        bytesWritten: 0,
        allowHalfOpen: true,
        writable: true,
        readable: true,
        server: [Object],
        ondrain: [Function],
        _idleTimeout: 120000,
        _idleNext: [Object],
        _idlePrev: [Circular],
        _idleStart: Thu, 19 Jul 2012 05:56:49 GMT,
        _events: [Object],
        ondata: [Function],
        onend: [Function] },
     _idlePrev: 
      { _idleNext: [Circular],
        _idlePrev: [Object],
        ontimeout: [Function] },
     _idleStart: Thu, 19 Jul 2012 05:56:49 GMT,
     _events: { timeout: [Object], error: [Function], close: [Object] },
     ondata: [Function],
     onend: [Function],
     _httpMessage: null },
  httpVersion: '1.1',
  complete: false,
  headers: 
   { host: 'jsgt.org:8124',
     connection: 'keep-alive',
     'cache-control': 'max-age=0',
     'user-agent': 'Mozilla/5.0 (Windows NT 5.1) AppleWebKit/536.11 (KHTML, like Gecko) Chrome/20.0.1132.57 Safari/536.11',
     accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
     'accept-encoding': 'gzip,deflate,sdch',
     'accept-language': 'ja,en-US;q=0.8,en;q=0.6',
     'accept-charset': 'Shift_JIS,utf-8;q=0.7,*;q=0.3',
     cookie: '__utma=243295390.443674676.1342001012.1342001012.1342001012.1; __utmz=243295390.1342001012.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)' },
  trailers: {},
  readable: true,
  url: '/',
  method: 'GET',
  statusCode: null,
  client: 
   { _handle: 
      { writeQueueSize: 0,
        socket: [Circular],
        onread: [Function: onread] },
     _pendingWriteReqs: 1,
     _flags: 0,
     _connectQueueSize: 0,
     destroyed: false,
     errorEmitted: false,
     bytesRead: 552,
     bytesWritten: 119,
     allowHalfOpen: true,
     writable: true,
     readable: true,
     server: 
      { connections: 2,
        allowHalfOpen: true,
        _handle: [Object],
        _events: [Object],
        httpAllowHalfOpen: false },
     ondrain: [Function],
     _idleTimeout: 120000,
     _idleNext: 
      { _handle: [Object],
        _pendingWriteReqs: 0,
        _flags: 0,
        _connectQueueSize: 0,
        destroyed: false,
        errorEmitted: false,
        bytesRead: 0,
        bytesWritten: 0,
        allowHalfOpen: true,
        writable: true,
        readable: true,
        server: [Object],
        ondrain: [Function],
        _idleTimeout: 120000,
        _idleNext: [Object],
        _idlePrev: [Circular],
        _idleStart: Thu, 19 Jul 2012 05:56:49 GMT,
        _events: [Object],
        ondata: [Function],
        onend: [Function] },
     _idlePrev: 
      { _idleNext: [Circular],
        _idlePrev: [Object],
        ontimeout: [Function] },
     _idleStart: Thu, 19 Jul 2012 05:56:49 GMT,
     _events: { timeout: [Object], error: [Function], close: [Object] },
     ondata: [Function],
     onend: [Function],
     _httpMessage: null },
  httpVersionMajor: 1,
  httpVersionMinor: 1,
  upgrade: false 
}

response-----------------------------------
{ output: [],
  outputEncodings: [],
  writable: true,
  _last: false,
  chunkedEncoding: true,
  shouldKeepAlive: true,
  useChunkedEncodingByDefault: true,
  _hasBody: true,
  _trailer: '',
  finished: true,
  socket: null,
  connection: null,
  _events: { finish: [Function] },
  statusCode: 200,
  _header: 'HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nConnection: keep-alive\r\nTransfer-Encoding: chunked\r\n\r\n',
  _headerSent: true 
}
```

リファレンスはこの辺
http://nodejs.jp/nodejs.org_ja/docs/v0.6/api/http.html

コードはこの辺
https://github.com/joyent/node/blob/master/lib/http.js