diff --git a/lib/request.js b/lib/request.js index 224cedb..189bdf8 100644 --- a/lib/request.js +++ b/lib/request.js @@ -9,7 +9,7 @@ */ var http = require('http') - , https = require('https') + , tls = require('tls') , methods = require('methods') , superagent = require('superagent') , Agent = superagent.agent @@ -283,7 +283,7 @@ function serverAddress (app, path) { if (!addr) { throw new Error('Server is not listening') } - var protocol = (app instanceof https.Server) ? 'https' : 'http'; + var protocol = (app instanceof tls.Server) ? 'https' : 'http'; // If address is "unroutable" IPv4/6 address, then set to localhost if (addr.address === '0.0.0.0' || addr.address === '::') { addr.address = '127.0.0.1';