You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to engine.io doc, it looks like the socket no longer emits the upgrade event, so it should be removed from this example.
By the way, I would like to ask how I should add some verification information in the upgrade request header, and reject the upgrade if the verification information is illegal.
The text was updated successfully, but these errors were encountered:
Hi! The upgrade event was indeed missing from the documentation, this should be fixed now (socketio/engine.io@535b068).
how I should add some verification information in the upgrade request header, and reject the upgrade if the verification information is illegal.
You can manually handle the upgrade event of the Node.js HTTP server:
import{createServer}from"http";import{Server}from"socket.io";consthttpServer=createServer();constio=newServer(httpServer);httpServer.removeAllListeners("upgrade");httpServer.on("upgrade",(req,socket,head)=>{// do some verification...// thenio.engine.handleUpgrade(req,socket,head);});httpServer.listen(3000);
According to engine.io doc, it looks like the socket no longer emits the
upgrade
event, so it should be removed from this example.By the way, I would like to ask how I should add some verification information in the upgrade request header, and reject the upgrade if the verification information is illegal.
The text was updated successfully, but these errors were encountered: