|
|
@ -21,7 +21,7 @@ |
|
|
|
|
|
|
|
var util = require('util'); |
|
|
|
var net = require('net'); |
|
|
|
var stream = require('stream'); |
|
|
|
var Stream = require('stream'); |
|
|
|
var url = require('url'); |
|
|
|
var EventEmitter = require('events').EventEmitter; |
|
|
|
var FreeList = require('freelist').FreeList; |
|
|
@ -263,7 +263,7 @@ function utcDate() { |
|
|
|
|
|
|
|
/* Abstract base class for ServerRequest and ClientResponse. */ |
|
|
|
function IncomingMessage(socket) { |
|
|
|
stream.Stream.call(this); |
|
|
|
Stream.call(this); |
|
|
|
|
|
|
|
// TODO Remove one of these eventually.
|
|
|
|
this.socket = socket; |
|
|
@ -290,7 +290,7 @@ function IncomingMessage(socket) { |
|
|
|
this.statusCode = null; |
|
|
|
this.client = this.socket; |
|
|
|
} |
|
|
|
util.inherits(IncomingMessage, stream.Stream); |
|
|
|
util.inherits(IncomingMessage, Stream); |
|
|
|
|
|
|
|
|
|
|
|
exports.IncomingMessage = IncomingMessage; |
|
|
@ -429,7 +429,7 @@ IncomingMessage.prototype._addHeaderLine = function(field, value) { |
|
|
|
|
|
|
|
|
|
|
|
function OutgoingMessage() { |
|
|
|
stream.Stream.call(this); |
|
|
|
Stream.call(this); |
|
|
|
|
|
|
|
this.output = []; |
|
|
|
this.outputEncodings = []; |
|
|
@ -447,7 +447,7 @@ function OutgoingMessage() { |
|
|
|
|
|
|
|
this.finished = false; |
|
|
|
} |
|
|
|
util.inherits(OutgoingMessage, stream.Stream); |
|
|
|
util.inherits(OutgoingMessage, Stream); |
|
|
|
|
|
|
|
|
|
|
|
exports.OutgoingMessage = OutgoingMessage; |
|
|
@ -1022,6 +1022,8 @@ ServerResponse.prototype.writeHeader = function() { |
|
|
|
// concerned with managing a connection pool.
|
|
|
|
|
|
|
|
function Agent(options) { |
|
|
|
EventEmitter.call(this); |
|
|
|
|
|
|
|
var self = this; |
|
|
|
self.options = options || {}; |
|
|
|
self.requests = {}; |
|
|
@ -1791,6 +1793,8 @@ exports._connectionListener = connectionListener; |
|
|
|
|
|
|
|
function Client(port, host) { |
|
|
|
if (!(this instanceof Client)) return new Client(port, host); |
|
|
|
EventEmitter.call(this); |
|
|
|
|
|
|
|
host = host || 'localhost'; |
|
|
|
port = port || 80; |
|
|
|
this.host = host; |
|
|
|