Izza
Izza

Reputation: 2419

TCP Server to push data to a Web Browser

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!!

Upvotes: 2

Views: 817

Answers (3)

Alex Ciminian
Alex Ciminian

Reputation: 11508

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.

Upvotes: 1

Redlab
Redlab

Reputation: 3118

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

Upvotes: 2

Digital Human
Digital Human

Reputation: 1637

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

Upvotes: 0

Related Questions