added javascript to listen for incoming sockets