S
S
SEOD2019-09-08 15:30:19
Backend
SEOD, 2019-09-08 15:30:19

How to connect backend (node.js) with frontend (html5)? TCP sockets?

It is planned to write simple games like chess. Client-server architecture. We plan to move the logic of the robot-opponent to the server with a back-end, Node.js, or Go. The frontend will be on HTML5 + PIXI.js, loaded like a regular site.
How do we connect the frontend to the backend for next moves and game tracking? TCP sockets with direct connection from JS (html5)? Or such connections are forbidden by modern browsers and we will get into trouble? :) Are there any methods of such communication between the server and the client that are better than this?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2019-09-08
@SEOVirus

WebSocket is the best option.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question