Coder
Coder

Reputation: 37

Can a web servers initiate communication with web browsers?

I was wondering can web servers initiate communication with web browsers? from my understanding they communicate but can web server innitiate it?

Upvotes: 1

Views: 1997

Answers (3)

zsimo
zsimo

Reputation: 121

Yes, you can use the WebSocket technology, takes a look here:

WebSocket

Upvotes: 1

Justin
Justin

Reputation: 885

Web servers using HTTP cannot. However, there are some new web technologies around the corner that hope to change that. Check out SPDY. One of their technical goals is:

To enable the server to initiate communications with the client and push data to the client whenever possible.

Upvotes: 0

SpliFF
SpliFF

Reputation: 39014

No. The client must establish and maintain some kind of connection, ie HTTP, WebSocket, or AJAX before the server can send any data. Once the browser window is closed the session is lost and the server can send no more data. In WebSockets the server can push data asynchronously but only through the established connection that the client initiated.

Upvotes: 2

Related Questions