H
Hono7d ago
Eternal

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
Eternal
EternalOP5d ago
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
ambergristle
ambergristle4d ago
could you share a little more about the issue you encountered? you're using a hono app to route to a socket.io server?
Eternal
EternalOP4d ago
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 ❤️

Did you find this page helpful?