clienttest.js 424 B

12345678910111213
  1. var other_server = require("socket.io-client")('http://127.0.0.1:3000'); // This is a client connecting to the SERVER 2
  2. other_server.on("connect",function(){
  3. other_server.on('message',function(data){
  4. // We received a message from Server 2
  5. // We are going to forward/broadcast that message to the "Lobby" room
  6. console.log("LOG GOT MESSAGE");
  7. chat.emit("a message",data);
  8. });
  9. });