Chat Socket IO

Chat with Socket.IO

The official Socket.IO Chat Example is working in Gameface out of the box.

To run it, follow the official chat guide document

In a few words, to run it you need to clone the repository, run npm i, npm run start and in the Gameface Player load the hosted http://localhost:3000/ address. In addition, to send a message through the running page in the Player, you need to add this to the index.html:

input.addEventListener('keydown', (event) => {
  if (event.keyCode === 13 && input.value) {
    socket.emit('chat message', input.value);
    input.value = '';
  }
});

Open a browser, send a message from the running page in the Player by typing something in the input and pressing Enter, and the message will be received in the browser. Works the other way around also.