What is the equivalent of this with the app router?
Unanswered
Japanese pilchard posted this in #help-forum
Japanese pilchardOP
Hello, I try to set up socket.io with the app router but I only see examples using the pages router. and it seems that you don't have access to the same values with the app router. You can do this with the pages router and it will print a value in the console:
But with app router I can't even access res.socket.
How should I do it?
// @/pages/api/socket.ts
import type { NextApiRequest, NextApiResponse } from 'next';
export default function handler(req: NextApiRequest, res: NextApiResponse) {
console.log(res.socket.server);
res.end("Hello");
}But with app router I can't even access res.socket.
How should I do it?