How do I make hono-session work with socket.io
hono-session
stores the decrypted cookie in the session section of the context object (c.get("session")
) but the context object is not available in socket.io
How do I make socket.io work with Hono-session?3 Replies
I found a solution
The client sends the encrypted cookie from hono-session along with the websocket request (you can get the cookie in the handshake)
Then, since I know the encryption password because I set it in hono- session, I just decrypt it with the Unseal function from Iron-webcrypto
could you share a little more about the issue you encountered?
you're using a hono app to route to a socket.io server?
I was
But now I'm using a regular http server for the websocket and separating the API and the websocket codebase
Sorry, I should have stated that I was using socket.io in the title
Thank you for following up with me, thought ❤️