diff --git a/lib/http.js b/lib/http.js index 701a5ccb86cc21..8431ab0d51ea39 100644 --- a/lib/http.js +++ b/lib/http.js @@ -21,14 +21,17 @@ 'use strict'; -const agent = require('_http_agent'); +const { Agent, globalAgent } = require('_http_agent'); const { ClientRequest } = require('_http_client'); -const common = require('_http_common'); -const incoming = require('_http_incoming'); -const outgoing = require('_http_outgoing'); -const server = require('_http_server'); - -const { Server } = server; +const { methods } = require('_http_common'); +const { IncomingMessage } = require('_http_incoming'); +const { OutgoingMessage } = require('_http_outgoing'); +const { + _connectionListener, + STATUS_CODES, + Server, + ServerResponse +} = require('_http_server'); function createServer(requestListener) { return new Server(requestListener); @@ -45,16 +48,16 @@ function get(options, cb) { } module.exports = { - _connectionListener: server._connectionListener, - METHODS: common.methods.slice().sort(), - STATUS_CODES: server.STATUS_CODES, - Agent: agent.Agent, + _connectionListener, + METHODS: methods.slice().sort(), + STATUS_CODES, + Agent, ClientRequest, - globalAgent: agent.globalAgent, - IncomingMessage: incoming.IncomingMessage, - OutgoingMessage: outgoing.OutgoingMessage, + globalAgent, + IncomingMessage, + OutgoingMessage, Server, - ServerResponse: server.ServerResponse, + ServerResponse, createServer, get, request