Connecting to a Javascript TCP Server

I created a server daemon that creates some data, such as messages, etc. But what they are interested in is customer monitoring. For example, I have a web page, and I need to establish a permanent Tcp connection with the server and show all incoming data in a text box. I know this can be done with flash, but im looking for a JS implementation.

Is this possible and what are the best practices?

+4
source share
2 answers

What you ask for is called Comet . There are many server programs and client libraries - see the related Wikipedia page.

+5
source

WebSockets is designed to solve this problem.

+4
source

Source: https://habr.com/ru/post/1286181/


All Articles