title: Browser creates connection to websocket repeatedly - socket.io
body: <p>I'm creating a socket.io and node.js server and it's saying there's many connections (every few minutes). It's creating a new id and it might interfere with other code that is using the id.</p>
  
  <p>Server code:</p>
  
  <pre><code>var express = require('express');
  
  var app = express();
  
  var server = app.listen(3000);
  
  app.use(express.static('public'));
  
  var socket = require('socket.io');
  
  var io = socket(server);
  
  io.sockets.on('connection', newConnection);
  
  function newConnection(socket) {
      console.log('new connection', socket.id);
  }
  </code></pre>
  
  <p>And in the console, when run:</p>
  
  <pre><code>new connection 12naA3AGFfkjDPdnAAAM
  new connection d_UeGFDAhsl401vFAAAN
  new connection xBCBtiLMNOVX37-KAAAO
  new connection RwmKzrVOGWRYeXNPAAAP
  new connection 5NZ9WZ1-_k27brq5AAAQ
  new connection QEbPMwPW69RYT15CAAAR
  new connection 7qrEvvRYpAF0Yw1dAAAS
  new connection -rV1aIgwrnPtZduyAAAT
  new connection HUTJO5P1Z-Cg4iAjAAAU
  new connection aPXmFpIu029CbUzZAAAV
  new connection EkGupV-aaU5ePuCyAAAW
  new connection E56CnnEXDryhFPGeAAAX
  </code></pre>
  
  <p>I'm not refreshing the page at all. How can I stop the server from connecting multiple times?</p>