mokyuM
Deno3y ago
3 replies
mokyu

Can someone explain WebSocketStream to me?

Whenever I try to connect using WebSocketStream and the host doesn't respond, my program inevitably crashes and stops. I'd like to have the program attempt to reconnect without stopping even if an error occurs, but I can't seem to make it work. Does anyone have a solution for this?

function webSocketStream_Connection() { try { const wss = new WebSocketStream("wss://localhost") } catch (err) { setTimeout(() => webSocketStream_Connection(), 5) } } webSocketStream_Connection()


error: Uncaught (in promise) ConnectionRefused: (os error 10061)
Was this page helpful?