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>
24 auto const& h = ws->request();
27 ws->port().secureGatewayNetsV4,
28 ws->port().secureGatewayNetsV6))
30 auto it = h.find(
"X-User");
33 fwdfor_ = std::string(::xrpl::forwardedFor(h));
55 boost::beast::multi_buffer sb;
57 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)