Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a HTTP Client connected to a HTTP Server - HTTP 1.1 and the TCP connection is persisted. HTTP client is sending request over an interval and receives response from server.

In this persisted TCP connection, can HTTP Server send a HTTP request over the existing TCP connection to the HTTP client? (We need this - say the page has an information which is changing dynamically (Example: some one hit a goal / some one hit six / some one took a wicket / some VVVIP killed / etc).

Does the existing standard allows HTTP server to send HTTP request to its connected client?

Note: I am not looking at page refresh / other web or application protocols like AJAX...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
327 views
Welcome To Ask or Share your Answers For Others

1 Answer

You are asking for a server push, and no, it is not supported by HTTP/1.1.

Requests headers are distinct from response headers, such that the push mechanism defined in the proposed HTTP/2 spec works by combining together the headers of the request and response.

You should look at AJAX/Comet because it essentially implements what you describe: the client-side application defines a method to receive any kind of game action, and then the server specifies which action occurred for each push.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...