1#ifndef XRPL_RPC_WSINFOSUB_H
2#define XRPL_RPC_WSINFOSUB_H
4#include <xrpld/rpc/InfoSub.h>
5#include <xrpld/rpc/Role.h>
7#include <xrpl/beast/net/IPAddressConversion.h>
8#include <xrpl/json/json_writer.h>
9#include <xrpl/server/WSSession.h>
26 auto const& h = ws->request();
30 ws->port().secure_gateway_nets_v4,
31 ws->port().secure_gateway_nets_v6))
33 auto it = h.find(
"X-User");
58 boost::beast::multi_buffer sb;
60 sb.commit(boost::asio::buffer_copy(
61 sb.prepare(n), boost::asio::buffer(data, n)));
Address const & address() const
Returns the address portion of this endpoint.
Abstracts the source of subscription data.
Manages a client's subscription to data feeds.
std::string_view forwarded_for() const
std::weak_ptr< WSSession > ws_
WSInfoSub(Source &source, std::shared_ptr< WSSession > const &ws)
std::string_view user() 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.
std::string_view forwardedFor(http_request_type const &request)
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 from_asio(boost::asio::ip::address const &address)