Expose http.ClientRequest and http.ServerResponse

pull/22966/head
Ryan Dahl 2009-11-04 12:37:52 +01:00
parent 711774c1f0
commit 60131fc88c
1 changed files with 2 additions and 0 deletions

View File

@ -314,6 +314,7 @@ function ServerResponse () {
this.use_chunked_encoding_by_default = true; this.use_chunked_encoding_by_default = true;
} }
process.inherits(ServerResponse, OutgoingMessage); process.inherits(ServerResponse, OutgoingMessage);
exports.ServerResponse = ServerResponse;
ServerResponse.prototype.sendHeader = function (statusCode, headers) { ServerResponse.prototype.sendHeader = function (statusCode, headers) {
var reason = STATUS_CODES[statusCode] || "unknown"; var reason = STATUS_CODES[statusCode] || "unknown";
@ -336,6 +337,7 @@ function ClientRequest (method, uri, headers) {
this.sendHeaderLines(method + " " + uri + " HTTP/1.0\r\n", headers); this.sendHeaderLines(method + " " + uri + " HTTP/1.0\r\n", headers);
} }
process.inherits(ClientRequest, OutgoingMessage); process.inherits(ClientRequest, OutgoingMessage);
exports.ClientRequest = ClientRequest;
ClientRequest.prototype.finish = function (responseListener) { ClientRequest.prototype.finish = function (responseListener) {
this.addListener("response", responseListener); this.addListener("response", responseListener);