feat: Proxy support (#2490)

Add client IP resolving support in case when there is a proxy in front
of Clio.
This commit is contained in:
Sergey Kuznetsov
2025-09-03 15:22:47 +01:00
committed by GitHub
parent 0a2930d861
commit 3a667f558c
39 changed files with 1042 additions and 125 deletions

View File

@@ -50,6 +50,7 @@
#include <string>
#include <string_view>
#include <utility>
#include <variant>
#include <vector>
namespace http = boost::beast::http;
@@ -81,8 +82,8 @@ syncRequest(
req.set(http::field::host, host);
req.set(http::field::user_agent, BOOST_BEAST_VERSION_STRING);
for (auto& header : additionalHeaders) {
req.set(header.name, header.value);
for (auto const& header : additionalHeaders) {
std::visit([&header, &req](auto const& name) { req.set(name, header.value); }, header.name);
}
req.target(target);
@@ -106,6 +107,10 @@ WebHeader::WebHeader(http::field name, std::string value) : name(name), value(st
{
}
WebHeader::WebHeader(std::string_view name, std::string value) : name(std::string{name}), value(std::move(value))
{
}
std::pair<boost::beast::http::status, std::string>
HttpSyncClient::post(
std::string const& host,