我可以通过 STDIN/STDOUT 说 HTTP/2 吗?如果是这样,我该怎么做,有什么限制?
最佳答案
严格来说HTTP/2 does by definition require a TCP connection :
An HTTP/2 connection is an application-layer protocol running on top of a TCP connection ([TCP]). The client is the TCP connection initiator.
HTTP/2 uses the same "http" and "https" URI schemes used by HTTP/1.1. HTTP/2 shares the same default port numbers: 80 for "http" URIs and 443 for "https" URIs. As a result, implementations processing requests for target resource URIs like http://example.org/foo or https://example.com/bar are required to first discover whether the upstream server (the immediate peer to which the client wishes to establish a connection) supports HTTP/2
话虽这么说,您可能可以调整协议(protocol)以在任何任意传输(如管道)上使用,但据我所知,目前没有软件可以以这种方式工作。如果确实存在这样的库,我希望在 HTTP/2 库的测试套件中看到它。这是一个网站containing a list of HTTP/2 test applications .其中一个可能具有与您正在寻找的模式相似的模式。
就优点和局限性而言,由于 HTTP/2 并非旨在以这种方式使用,因此我不确定在任何情况下都有多少优势。主要限制是相同的:大多数软件无法使用管道。
关于http2 - 我可以通过 STDIN/STDOUT 说 HTTP/2 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52489697/