2015-05-19 13:00:06 +02:00
|
|
|
'use strict';
|
2016-05-29 03:06:56 -04:00
|
|
|
require('../common');
|
2013-11-03 14:32:03 -08:00
|
|
|
|
|
|
|
var http = require('http');
|
|
|
|
|
|
|
|
http.createServer(function(req, res) {
|
|
|
|
res.end('ok\n');
|
|
|
|
this.close();
|
2016-05-29 03:06:56 -04:00
|
|
|
}).listen(0, test);
|
2013-11-03 14:32:03 -08:00
|
|
|
|
|
|
|
function test() {
|
|
|
|
http.request({
|
2016-05-29 03:06:56 -04:00
|
|
|
port: this.address().port,
|
2013-11-03 14:32:03 -08:00
|
|
|
encoding: 'utf8'
|
|
|
|
}, function(res) {
|
|
|
|
res.pipe(process.stdout);
|
|
|
|
}).end();
|
|
|
|
}
|