title: Copying a websocket not possible in Node.js?
body: <p>So, I want to move a websocket instance on my Node.js server from one array to the other. I use <code>JSON.parse(JSON.stringify(theitem))</code>, and it sticks in there just fine - but then it gives me a peculiar error.</p>
  
  <pre><code>var ws = require("ws");
  var server = new ws.Server({server:app.server, path:"/whatever", port:8080})
  var clients = [];
  var OtherClients = [];
  server.on("connection", function(socket){
       socket.send("Hello!"); // This works.
       socket.on("message", function(msg){console.log("whatever");})
       clients.push({socket:socket, OtherInformation:"whatever!"});
       NextFunction();
  })
  
  function NextFunction(){
       for(let i = 0; i &lt; clients.length; i+=2){ // Every second one, meant to represent arbitrary logic...
            clients.forEach(TheClient=&gt;{
                 TheClient.socket.send("Arbitrary string!"); // This one works.
            })
       }
       OtherClients[0] = JSON.parse(JSON.stringify(clients[clients.length-1]));
       clients.splice(0,1);
       OtherClients[0].socket.send("Another arbitrary string!"); // Crash here.
  }
  </code></pre>
  
  <p>This gives me the error <code>TypeError: OtherClients[0].socket.send is not a function</code>. How?</p>
  
  <p>Moreover, I noticed that socket.send is not actually a member of the socket object (even in the original version where I can send it). What's going on? </p>
  
  <p>Am I really not allowed to copy a WebSocket object, or am I missing the point <em>entirely</em>?</p>