UNPKG

@risingstack/trace

Version:
21 lines (17 loc) 620 B
var Shimmer = require('../../utils/shimmer') var mustCollectStore = {} module.exports = function (https, agent) { Shimmer.wrap(https.Server.prototype, 'https.Server.prototype', ['on', 'addListener'], function (addListener) { return function (type, listener) { if (type === 'request' && typeof listener === 'function') { return addListener.call(this, type, require('./http/server.js')(listener, agent, mustCollectStore)) } else { return addListener.apply(this, arguments) } } }) agent.bindEmitter(https.Server.prototype) return https }