title: WebSocket in Firefox establish two connection
body: <p>I'm coding a WebSocket server in Java. When I use WebSocket to connect to the server in firefox, I found two connection were established, and one of them never send any data...<br/>
  My firefox version is 15.0.1<br/>
  The same code run in Chrome is OK, connect once, established only one connection.<br/>
  Does anybody have the trouble like this?</p>
  
  <p>There is the server's code:</p>
  
  <pre><code>ServerSocket svrSock = new ServerSocket();
  svrSock.bind(new InetSocketAddress("0.0.0.0", 11111));
  while(true) {
      try {
          // accept connection
          Socket clientSock = svrSock.accept();
          // print the socket which connected to this server
          System.out.println("accept socket: " + clientSock);
  
          // run a thread for client
          new ClientThread(clientSock).start();
      } catch (Exception e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>And there is the js code:</p>
  
  <pre><code>var url = 'ws://localhost:11111/test/';
  var ws = new WebSocket(url);
  ws.onopen = function(){
      console.log('connected!');
      ws.send(11111);
      ws.close();
  };
  ws.onclose = function(){
      console.log('closed!');
  };
  </code></pre>
  
  <p>When I run this js code in firefox, I get this in my server console:</p>
  
  <blockquote>
    <p>accept socket: Socket[addr=/127.0.0.1,port=56935,localport=11111]<br/>
    accept socket: Socket[addr=/127.0.0.1,port=56936,localport=11111]</p>
  </blockquote>