3#include <xrpld/rpc/Role.h>
5#include <xrpl/beast/net/IPAddressConversion.h>
6#include <xrpl/json/json_writer.h>
7#include <xrpl/server/InfoSub.h>
8#include <xrpl/server/WSSession.h>
27 auto const& h = ws->request();
30 ws->port().secureGatewayNetsV4,
31 ws->port().secureGatewayNetsV6))
33 auto it = h.find(
"X-User");
36 fwdfor_ = std::string(::xrpl::forwardedFor(h));
58 boost::beast::multi_buffer sb;
60 sb.commit(boost::asio::buffer_copy(sb.prepare(n), boost::asio::buffer(data, n)));
Abstracts the source of subscription data.
WSInfoSub(Source &source, std::shared_ptr< WSSession > const &ws)
std::weak_ptr< WSSession > ws_
std::string_view user() const
std::string_view forwardedFor() const
void send(json::Value const &jv, bool) override
void stream(json::Value const &jv, Write const &write)
Stream compact JSON to the specified function.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool ipAllowed(beast::ip::Address const &remoteIp, std::vector< boost::asio::ip::network_v4 > const &nets4, std::vector< boost::asio::ip::network_v6 > const &nets6)
True if remoteIp is in any of adminIp.
static ip::Endpoint fromAsio(boost::asio::ip::address const &address)