|
@ -20,35 +20,43 @@ |
|
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
// USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
|
|
|
|
'use strict'; |
|
|
'use strict'; |
|
|
exports.IncomingMessage = require('_http_incoming').IncomingMessage; |
|
|
|
|
|
|
|
|
|
|
|
exports.OutgoingMessage = require('_http_outgoing').OutgoingMessage; |
|
|
|
|
|
|
|
|
|
|
|
exports.METHODS = require('_http_common').methods.slice().sort(); |
|
|
|
|
|
|
|
|
|
|
|
const agent = require('_http_agent'); |
|
|
const agent = require('_http_agent'); |
|
|
exports.Agent = agent.Agent; |
|
|
const client = require('_http_client'); |
|
|
exports.globalAgent = agent.globalAgent; |
|
|
const common = require('_http_common'); |
|
|
|
|
|
const incoming = require('_http_incoming'); |
|
|
|
|
|
const outgoing = require('_http_outgoing'); |
|
|
const server = require('_http_server'); |
|
|
const server = require('_http_server'); |
|
|
exports.ServerResponse = server.ServerResponse; |
|
|
|
|
|
exports.STATUS_CODES = server.STATUS_CODES; |
|
|
|
|
|
exports._connectionListener = server._connectionListener; |
|
|
|
|
|
const Server = exports.Server = server.Server; |
|
|
|
|
|
|
|
|
|
|
|
exports.createServer = function createServer(requestListener) { |
|
|
const Server = server.Server; |
|
|
return new Server(requestListener); |
|
|
const ClientRequest = client.ClientRequest; |
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const client = require('_http_client'); |
|
|
function createServer(requestListener) { |
|
|
const ClientRequest = exports.ClientRequest = client.ClientRequest; |
|
|
return new Server(requestListener); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
exports.request = function request(options, cb) { |
|
|
function request(options, cb) { |
|
|
return new ClientRequest(options, cb); |
|
|
return new ClientRequest(options, cb); |
|
|
}; |
|
|
} |
|
|
|
|
|
|
|
|
exports.get = function get(options, cb) { |
|
|
function get(options, cb) { |
|
|
var req = exports.request(options, cb); |
|
|
var req = request(options, cb); |
|
|
req.end(); |
|
|
req.end(); |
|
|
return req; |
|
|
return req; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
module.exports = { |
|
|
|
|
|
_connectionListener: server._connectionListener, |
|
|
|
|
|
METHODS: common.methods.slice().sort(), |
|
|
|
|
|
STATUS_CODES: server.STATUS_CODES, |
|
|
|
|
|
Agent: agent.Agent, |
|
|
|
|
|
ClientRequest, |
|
|
|
|
|
globalAgent: agent.globalAgent, |
|
|
|
|
|
IncomingMessage: incoming.IncomingMessage, |
|
|
|
|
|
OutgoingMessage: outgoing.OutgoingMessage, |
|
|
|
|
|
Server, |
|
|
|
|
|
ServerResponse: server.ServerResponse, |
|
|
|
|
|
createServer, |
|
|
|
|
|
get, |
|
|
|
|
|
request |
|
|
}; |
|
|
}; |
|
|