您将如何设计一个完全支持 HTTP 1.1 keep-alive 的代理服务器?
看来 nginx 也只有一半支持 HTTP 1.1 keep-alive 请求:
它是一个 HTTP/1.0 代理,没有 保持活动请求的能力。 (因此,后端连接是 创建和销毁在每个 请求。)Nginx 与 HTTP/1.1 对话 浏览器和 HTTP/1.0 到后端 服务器。因此它处理保持活动状态 到浏览器。 (来源)
如果是你,你会如何实现这个?
我认为最难的部分是如何使响应的顺序与保活模式下请求的顺序相同。
It seems even nginx only half supports HTTP 1.1 keep-alive requests:
It is an HTTP/1.0 proxy without the
ability for keep-alive requests yet.
(As a result, backend connections are
created and destroyed on every
request.) Nginx talks HTTP/1.1 to the
browser and HTTP/1.0 to the backend
server. As such it handles keep-alive
to the browser. (source)
Were it you,how would you implement this?
The hardest part I think is how to make the response the same order as requested in keep-alive mode.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论