nodejs – 如何在ws(einaros)中获取cookie

在socketio中,我可以使用socket.handshake.headers.cookie轻松获取cookie。 我怎么能在ws做同样的事情?

你可以试试这个: ws.upgradeReq.headers.cookie