question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Experiencing frequent websocket stream reconnects

See original GitHub issue

Using version 1.10 and the sample code from the readme, roughly every minute a reconnect occurs, preceded by the following message:

[ERROR:root] 2019-10-11 16:38:18,582 - Error connecting to CertStream - Connection is already closed. - Sleeping for a few seconds and trying again...

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Fitblipcommented, Dec 20, 2019

Hey folks, sorry for the delay here.

Digging into this, it looks like cowboy (the underlying websocket server for certstream) will timeout connections after a minute and force reconnection - https://github.com/ninenines/cowboy/issues/1259

I didn’t realize this and figured another mechanism would be handling heartbeats, which doesn’t seem to be the case. I’m going to add heartbeating to this and the other clients which should (hopefully) remedy these timeout issues (the golang client is experiencing this as well - https://github.com/CaliDog/certstream-go/issues/8).

0reactions
Fitblipcommented, Dec 23, 2019

Thanks for the info! Cheers, and happy holidays!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling connection loss with websockets - Stack Overflow
Client side, connection is simply: var websocket_conn = new WebSocket('ws://192.168.0.5:3000'); websocket_conn. onopen = function(e) { console. log('Connected!
Read more >
How to Avoid Multiple WebSocket Connections in a React ...
In this post, you'll learn how WebSocket connections work in a React Chat app and how to avoid concurrent connections with Stream's Chat ......
Read more >
Websocket connection disconnecting after ping - Forum
The websocket is closed and our apps tries to reconnect. It does, then the ping disconnect action starts to take place again. We...
Read more >
design patterns - Websocket client reconnection best practices
This is such a common function, there must be some best practices and techniques. I can find lots of examples of how to...
Read more >
Troubleshooting connection issues | Socket.IO
Since the format of the packets sent over the WebSocket transport is similar in v2 and v3/v4, you might be able to connect...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found