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.
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?