mirror of
https://github.com/XRPLF/clio.git
synced 2025-12-06 17:27:58 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user