njoubert / node-groupme

A GroupMe API Module for NodeJS, downloaded over 9000 times on npmjs.com
zlib License
29 stars 21 forks source link

IncomingStream becomes inactive #10

Open ghost opened 6 years ago

ghost commented 6 years ago

Hi, I recently started using your module, and when I created an IncomingStream to detect messages to a user, everything works fine for a while. But after a few minutes of inactivity the on('message') events appear to stop firing.

Is there something I need to do to keep the connection fresh, or to keep the message events firing?

Thanks!

not-so-smart commented 3 years ago

This is because the groupme package doesn't handle websocket connections correctly. As mentioned in the API docs, the client token must be refreshed every (x) interval. The interval has changed since the documentation was written, but a proper implementation would handle this correctly regardless of the interval.

Check out the node-groupme package in my repository for an updated library that properly handles the GroupMe websocket interface.

https://github.com/not-so-smart/node-groupme