title: websocket connection is closing automatically
body: <p>i have deployed websocket server on heroku and Everything is working good but if there is no transfer between server and client after a certain time the connection is closed. i don't know who is closing the connection server or client and how to resolve this issue.</p>
  
  <p>here is my node.js client code-</p>
  
  <pre><code>const Websocket = require('ws');
  
  var ws = new Websocket('https://secure-mountain-02060.herokuapp.com/');
  
  ws.onmessage = function(event){
  console.log(event.data);
  }
  
  ws.onclose = function(){
  console.log('server close');
  }
  </code></pre>