Closed liemnotliam closed 3 years ago
maybe socket.io-admin could filter the handshake object based on its interface
Sounds good to me. Would you have time to open a PR for this?
Haven't done a lot of TypeScript but there doesn't seem to be a nice way to get the interface keys without hardcoding them, any thoughts or suggestions?
I think the easiest way would indeed be to hardcode them, which is fine in this case I think.
This should be fixed by https://github.com/socketio/socket.io-admin-ui/commit/1cf991e49a1e2b172acca40ca3d259dad9c22915, included in version 0.1.2
.
I have an application that shares an express session with socket.io. The session is backed by a redis store. The admin runs fine when the socket.io server starts but crashes when a client connects to the socket.io server.
From what I gathered, the crash happens because the socket serialisation in https://github.com/socketio/socket.io-admin-ui/blob/f45342266245fe3fa0049ea7ba556a9e071b056f/lib/index.ts#L349 contains redis related things in
socket.handshake
:I'm not quite sure where that
sessionStore
is added tosocket.handshake
but maybe socket.io-admin could filter the handshake object based on its interface in https://github.com/socketio/socket.io/blob/b84ed1e41c9053792caf58974c5de9395bfd509f/lib/socket.ts#L64?