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