Node js server not working
<p>I am trying to make a node js server with ws module. But it's not working. It says upgrade required.</p>

<p>My server side code:   </p>

<pre><code>var WebSocketServer = require('ws').Server; 
wss = new WebSocketServer({port: 8080});

wss.on('connection', function(ws) {
  ws.on('message', function(message) {
    console.log('Msg received in server: %s ', message);
});

ws.send('Msg from server');
});
</code></pre>

<p>Client side code:</p>

<pre><code>var WebSocket = require('ws');
var ws = new WebSocket('ws://localhost:8080/');
ws.on('open', function() {
  ws.send('Msg from client');
});
ws.on('message', function(data, flags) {
  console.log('Msg received in client: %s ', data);
});
</code></pre>