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
You can use the whole ecosystem of middlewares from tower-http that is available for Axum.
Check the use of CorsLayer in the chat example and you can do the same with the AsyncRequireAuthorizationLayer.
With that you will protect you're entire server. If you want to only protect a namespace you can do the same thing than in the chat example. You just need the SocketReq data that is in the socket.handshake struct. With that you will be able to get your headers/uri to access credentials.
There is no custom event for the moment, there is PR open to have a disconnect event #41. There is no connect event planned but the content of the handler will be trigger when you're socket is connected
I saw a similar feature in node js socketio server (middlewares). Also, where are the reserved events, such as "connection", "disconnect" etc?
The text was updated successfully, but these errors were encountered: