web socket keeps on disconnecting and connecting
Hi! Its my first time using web sockets. The first code snippet is my socket code. The second code snippet is where I create context to use in the
applyWSSHandler
. My issue is that in my createContext
function. When I try to use the getUser function, the socket keeps on connecting and disconnecting rapidly (like every few milliseconds). But the moment I remove that function, everything works fine. Any idea what could be issue? The create context has no issue without running the socket.
Thank you!
4 Replies
my thinking is that your create context fails and throws an error
maybe the auth doesn't work with WSS
I see! In that case, I'll just try using Pusher instead. Thank you!
hey mate, can you give me some code or link to show me how to integrate Pusher or Ably with tRPC?Thanks in advance
You can checkout this youtube video: https://www.youtube.com/watch?v=Dw4vF2nftAE
Jump to the 10min mark
Scalable Scripts
YouTube
Build a Realtime Chat App with React
👉 Check our website: https://scalablescripts.com
Learn how to create a Realtime Chat App with React and Pusher.
Source Code: https://github.com/scalablescripts/react-chat
This video can be combined with other videos:
React and NodeJS Chat App: https://www.youtube.com/playlist?list=PLlameCF3cMEvB8N2bhctdqCMfj1q5aiZh
React and NestJS Chat App:...