thibauts / node-castv2

An implementation of the Chromecast CASTV2 protocol
MIT License
774 stars 100 forks source link

Reversed heartbeat #47

Open oliverpool opened 7 years ago

oliverpool commented 7 years ago

Hi,

thank you so much for the readme: it contains invaluable information!

Regarding the heartbeat, it seems sufficient to just reply to the PINGs sent from (and to) Tr@n$p0rt-0 with a PONG with the same transport (example in my repo: https://github.com/oliverpool/go-chromecast/blob/master/command/heartbeat/heartbeat.go#L14)

This way you don't have to guess the right interval to send your ping: just wait for a ping and reply to it :-)