sockjs/sockjs-client — pull request #167 by thebillkidy (2014-05-15 07:45:37+00:00)
Title: Implemented heartbeat checks and timeout option

This will check if we receive heartbeats from the server, if it does then it clears a timeout. if it doesn't then it closes our connection to ensure that we are able to reconnect on the client side.

To enable this, you can apply the option heartbeatTimeout, example:
```javascript
socket = new SockJS('https://URLHERE/echo', null, { heartbeatTimeout: 65000 });
```

This will timeout after 65 seconds (nginx long living requests timeout) and trigger the onClose event. This way we are able to reconnect to our socket. This will only happen if we did not receive any heartbeats for more then 65 seconds.