When I connect to my Express 4 node.js websocket server from my client and try to log req, the whole program just gets stuck. It still accepts new connections and executes it to the same console.log, but then gets stuck. I am trying to figure out what req contains, but this way of figuring it out doesn't seem to work.
app.use(function (req, res, next) {
console.log("middleware");
var session = req.session;
console.log("session: " + JSON.stringify(session));
console.log("req non json: " + req);
console.log("req: " + JSON.stringify(req)); //stuck
return next();
});
req
due to circular references. Tryconsole.log('req:', req)
. – Beanstalk+
stringifiesreq
, using it as a separate argument will makeconsole.log()
useutil.inspect()
. – Beanstalk