title: Socket.io sends two messages
body: <p>I'm trying to setup socket.io and here is part of my server.js</p>
  
  <pre><code>const app = require('express')();
  const http = require('http').Server(app);
  const io = require('socket.io')(http, { path: '/websocket', origins:'*:*' });
  
  io.on('connection', (socket) =&gt; {
  socket.send('Hi');
  socket.on('message', (message) =&gt; {
      console.log(message);
      socket.emit('hello', `New: ${message}`);
  });
      console.log('a user connected');
  });
  
  http.listen(3030, function(){
     console.log('listening on *:3030');
  });
  </code></pre>
  
  <p>and my simple client:</p>
  
  <pre><code>var socket = io('https://*******.com', {
    secure: true,
    path: '/websocket'
  });
  
  const input = document.getElementById('text');
  const button = document.getElementById('button');
  const msg = document.getElementById('msg');
  
  button.onclick = () =&gt; {
      socket.emit('message', input.value);
      socket.on('hello', (text) =&gt; {
          const el = document.createElement('p');
          el.innerHTML = text;
          msg.appendChild(el);
      })
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/2lC3r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/2lC3r.png" alt="enter image description here"></a></p>
  
  <p>And if I'll click for third time I receive a 3 messages back and so on. What I'm doing wrong? I wish to send message to the server and receive modified message back.
  I'm new in web sockets.</p>
  
  <p>Any help appreciated.</p>
  
  <p>P.S. socket.io v2.0.1</p>