WebSocket Authentication: Cookie missing
Hi community ๐
I'm currently trying to integrate the wsLink, and I've noticed that cookies are not automatically sent during initialization (first request).
What could be the reason for this? My website runs under the URL http://localhost:3000, and the web server under http://localhost:3001. Does it have something to do with CORS?
Example HTTP-Headers:
Example WebSocket-Headers:
I created the WebSocket client as follows:
Server Environment:
Tested with Bun v1.0.29 and Node v20.10.0
Client Environment:
Thank you in advance. Regards, Tobi1 Reply
Localhost:3000 is considered a different host then localhost:3001, therefor it will not send the cookie with. The way that I deal with this is by proxying both next and the ws server, and have the ws server use /ws.
https://github.com/BeBoRE/ei-noah-bot/blob/master/apps/proxy/proxy.ts
GitHub
ei-noah-bot/apps/proxy/proxy.ts at master ยท BeBoRE/ei-noah-bot
De officiรซle Discord Bot voor de Sweaty GG Chat. Contribute to BeBoRE/ei-noah-bot development by creating an account on GitHub.