Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript TCP connection to server

I have created server daemon, that produces some data, like messages and so. But, what im interested in - client monitoring. For example i have web page, and i need to establish persistent Tcp connection to server and show all incoming data into textbox. I know it can be done with flash, but im searching for JS implementation.

Is it possible and what`s the best practices ?

like image 409
Dan Sosedoff Avatar asked Jan 24 '23 12:01

Dan Sosedoff


2 Answers

What you're asking for is known as Comet. Plenty of server software and client libraries exist - see the linked Wikipedia page.

like image 125
RichieHindle Avatar answered Jan 26 '23 03:01

RichieHindle


WebSockets is designed to solve this problem.

like image 21
jnnnnn Avatar answered Jan 26 '23 01:01

jnnnnn