CaliDog / certstream-go

Go library for connecting to CertStream
MIT License
140 stars 33 forks source link

Add heartbeats #9

Closed alsyia closed 4 years ago

alsyia commented 4 years ago

Hello!

Related to https://github.com/CaliDog/certstream-go/issues/8

This PR adds heartbeats so that the Certstream server (or rather, Cowboy), won't disconnect the client after some time. I also added a read timeout so that the client can reconnect if the connection breaks. Even with properly configured heartbeats, the public Certstream server seems to be very slow to answer heartbeats, and clients are sometimes disconnected because of that.

I've been using this code with my own Certstream server instance for a few weeks now and all connectivity issues have disappeared.

Does it look good to you?

Fitblip commented 4 years ago

Hi there, this is great! Many thanks for implementing it and sorry for the delay in merging.

Cheers, and be well!