facebook / proxygen

A collection of C++ HTTP libraries including an easy to use HTTP server.
Other
8.03k stars 1.47k forks source link

Upstream HTTP2 #451

Closed SteveSelva closed 10 months ago

SteveSelva commented 10 months ago

Does Proxygen supports multiplexing over HTTP2 in Upstream Connections by default?

Since multiplexing is protocol requirement for HTTP2, is it implemented by default for Upstream Connections?

But I found that for each request from downstream, new connection is being created for upstream. If not implemented by default, how to implement it?

afrind commented 10 months ago

Yes it supports using H2. When creating the upstream connection, just make sure you are using TLS and the "h2" ALPN is set. If the server supports H2 it will be negotiated and used. You can follow how the curl sample does it here: https://github.com/facebook/proxygen/blob/main/proxygen/httpclient/samples/curl/CurlClientMain.cpp.

See also #449 regarding how to pool session objects.