diff --git a/plugins/internal-redirect.js b/plugins/internal-redirect.js index 2d50108..088ccab 100644 --- a/plugins/internal-redirect.js +++ b/plugins/internal-redirect.js @@ -26,8 +26,7 @@ exports.run = function(api) { var rootRelUrl = pUrl.pathname; if (pUrl.search) rootRelUrl += pUrl.search; - var client = HTTP.createClient(port, hostname); - var clientReq = client.request('GET', rootRelUrl, { host: hostname }); + var clientReq = HTTP.request('GET', rootRelUrl, { host: hostname }); clientReq.end(); clientReq.on('response', function(resp) { var hts = new HTS.HttpTransactionState(); diff --git a/test.js b/test.js index 4188af2..5a64c21 100644 --- a/test.js +++ b/test.js @@ -25,7 +25,11 @@ HTTP.createServer(function(req, resp){ }).listen(8081); console.log('created test server'); -var cl = HTTP.createClient(8080, 'localhost'); +var options = { + hostname: 'localhost', + port: 8080 +}; +var req = HTTP.get(options); var req = cl.request('get', 'http://localhost:8081/', {host:'localhost'}); req.end();