2

I have a TCP server, which is connected to a web page via a Web browser. It is easy to send a request to the TCP server by the web page via the Web Browser, but is there a way that TCP server can push data to the web browser, without waiting for a request from browser side?? My initial idea was that this is impossible, since a browser is stateless. But I was told there are ways to do that... Any ideas?

Thank You!!

Izza
  • 2,389
  • 8
  • 38
  • 60

3 Answers3

2

You'll need the experimental HTML 5 Websockets see slides for the idea, or other server push stuff

Redlab
  • 3,110
  • 19
  • 17
1

From what I know, WebHooks and Comet are the only ways to push data from the server to the client, while still using HTTP. See if they're what you're looking for :).

Update

Try websockets (with socket.io, if that's available). Also, check out meteor for inspiration.

Alex Ciminian
  • 11,398
  • 15
  • 60
  • 94
0

yes use the (network)stream to write data to the webserver

Digital Human
  • 1,599
  • 1
  • 16
  • 26