markoM
tRPCβ€’3y agoβ€’
4 replies
marko

WebSocket connection hangs after significant amount of data passed through the connection.

Hey!

I've been really enjoying using tRPC on my latest project, but have gotten stuck getting websockets to work properly these last few days.

I'm able to establish a connection and successfully pass data back and forth between the client and server, but after a certain amount of data has been passed over the connection, the server stops responding without any error (the connection remains alive).

There's no clear pattern as to why, besides it depending on the amount of data. I can pass 10 very large messages before it hangs, or 100+ smaller messages, and get the same result.

I've tried going around tRPC and establishing a direct websocket connection with the server (I'm using tRPC + Fastify), and don't encounter this issue, so it seems to be something with tRPC.

Let me know if there's any more information I can provide to help you help me πŸ™‚ Thank you!!
Was this page helpful?