我想在我的 express 3 路由中使用 http.Server.connections?是不是再也没有办法获得了?
我应该只是 app.set('server', server);
express.createServer() 已弃用,express 应用程序不再继承自 http.Server
var app = express(),
server = http.createServer(app);
server.listen(8080);
...
module.exports = function (app) {
app.get('/connections', function (req, res) {
res.send({
connections: app.connections
// app != http.Server in express 3
});
});
};