Skip to content
← Back to Community
Chat box
Profile icon
KadenGarner

Hi i need help coding a mini chat box for my multiplayer game if someone can help me please comment.

Answered by RYANTADIPARTHI [earned 5 cycles]
View Answer
Voters
Profile icon
KadenGarner
Comments
hotnewtop
Profile icon
RYANTADIPARTHI

you can use node.js for this, with websockets

https://www.freecodecamp.org/news/simple-chat-application-in-node-js-using-express-mongoose-and-socket-io-ee62d94f5804/

Profile icon
KadenGarner
Profile icon
RYANTADIPARTHI

@KadenGarner no problem.

Profile icon
19wintersp

You can open a WebSocket connection from each client to the server, and then whenever a message is sent on the WebSocket, broadcast it to every other client.

On the frontend, just create an element with an input box, and send/receive messages over the WebSocket connection.

Profile icon
KadenGarner