HTTP请求源自HTTP服务器

编程入门 行业动态 更新时间:2024-10-12 18:16:50
本文介绍了HTTP请求源自HTTP服务器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个连接到HTTP Server-HTTP 1.1的HTTP客户端,并且TCP连接保持不变. HTTP客户端在一定时间间隔内发送请求,并接收来自服务器的响应.

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.

在此持久的TCP连接中,HTTP Server可以通过现有的TCP连接向HTTP客户端发送HTTP请求吗?(我们需要这样做-表示页面中的信息正在动态变化(示例:有人击中一个目标/有人击中6/有人击中一个检票口/有人杀死了VVVIP等)

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).

现有标准是否允许HTTP服务器向其连接的客户端发送HTTP请求?

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

注意:我不是在查看页面刷新/其他Web或应用程序协议,例如AJAX ...

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

推荐答案

您正在请求服务器推送,否,HTTP/1.1不支持它.

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

请求标头与响应标头不同,例如,推送机制提议的HTTP/2规范通过将请求和响应的标头组合在一起而起作用.

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.

您应该查看 AJAX/Comet ,因为它实质上实现了您所描述的内容:客户端应用程序定义了一种接收任何类型的游戏动作的方法,然后服务器指定每次按下时发生的动作.

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.

更多推荐

HTTP请求源自HTTP服务器

本文发布于:2023-07-14 10:22:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1104095.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:服务器   HTTP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!