1#include <xrpld/app/main/Application.h>
2#include <xrpld/core/ConfigSections.h>
3#include <xrpld/overlay/Overlay.h>
4#include <xrpld/rpc/RPCHandler.h>
5#include <xrpld/rpc/Role.h>
6#include <xrpld/rpc/ServerHandler.h>
7#include <xrpld/rpc/detail/Tuning.h>
8#include <xrpld/rpc/detail/WSInfoSub.h>
9#include <xrpld/rpc/json_body.h>
11#include <xrpl/basics/base64.h>
12#include <xrpl/basics/contract.h>
13#include <xrpl/basics/make_SSLContext.h>
14#include <xrpl/beast/net/IPAddressConversion.h>
15#include <xrpl/beast/rfc2616.h>
16#include <xrpl/core/JobQueue.h>
17#include <xrpl/json/json_reader.h>
18#include <xrpl/json/to_string.h>
19#include <xrpl/protocol/ApiVersion.h>
20#include <xrpl/protocol/ErrorCodes.h>
21#include <xrpl/protocol/RPCErr.h>
22#include <xrpl/resource/Fees.h>
23#include <xrpl/resource/ResourceManager.h>
24#include <xrpl/server/NetworkOPs.h>
25#include <xrpl/server/Server.h>
26#include <xrpl/server/SimpleWriter.h>
27#include <xrpl/server/detail/JSONRPCUtil.h>
29#include <boost/algorithm/string.hpp>
30#include <boost/beast/http/fields.hpp>
31#include <boost/beast/http/string_body.hpp>
48 return request.version() >= 11 && request.target() ==
"/" && request.body().size() == 0 &&
49 request.method() == boost::beast::http::verb::get;
55 using namespace boost::beast::http;
57 response<string_body> msg;
58 msg.version(request.version());
61 msg.insert(
"Content-Type",
"text/html");
62 msg.insert(
"Connection",
"close");
63 msg.body() =
"Invalid protocol.";
64 msg.prepare_payload();
76 auto const it = h.
find(
"authorization");
77 if ((it == h.
end()) || (it->second.substr(0, 6) !=
"Basic "))
80 boost::trim(strUserPass64);
82 std::string::size_type
const nColon = strUserPass.
find(
':');
83 if (nColon == std::string::npos)
87 return strUser == port.
user && strPassword == port.
password;
93 boost::asio::io_context& io_context,
99 , m_resourceManager(resourceManager)
100 , m_journal(app_.getJournal(
"Server"))
101 , m_networkOPs(networkOPs)
102 , m_server(
make_Server(*this, io_context, app_.getJournal(
"Server")))
103 , m_jobQueue(jobQueue)
105 auto const& group(cm.
group(
"rpc"));
127 auto const endpointPort = it->second.port();
129 port.port = endpointPort;
132 (port.protocol.count(
"http") > 0 || port.protocol.count(
"https") > 0))
135 if ((
setup_.
overlay.port() == 0u) && (port.protocol.count(
"peer") > 0))
158 auto const& port = session.
port();
160 auto const c = [
this, &port]() {
165 if ((port.limit != 0) && c >= port.limit)
167 JLOG(
m_journal.
trace()) << port.name <<
" is full; dropping " << endpoint;
179 boost::asio::ip::tcp::endpoint
const& remote_address)
181 using namespace boost::beast;
184 p.
count(
"ws") > 0 || p.count(
"ws2") > 0 || p.count(
"wss") > 0 || p.count(
"wss2") > 0};
186 if (websocket::is_upgrade(request))
206 beast_remote_address,
210 is->forwarded_for());
211 ws->appDefined = std::move(is);
215 handoff.
moved =
true;
219 if (bundle && p.count(
"peer") > 0)
232 return [&](boost::beast::string_view
const& b) { session.
write(b.data(), b.size()); };
239 for (
auto const& e : h)
245 return std::tolower(static_cast<unsigned char>(kc));
252template <
class ConstBufferSequence>
256 using boost::asio::buffer_size;
262 s.
append(
static_cast<char const*
>(b.data()), buffer_size(b));
290 if (postResult ==
nullptr)
294 detachedSession->close(
true);
305 auto const size = boost::asio::buffer_size(buffers);
309 jvResult[jss::type] = jss::error;
310 jvResult[jss::error] =
"jsonInvalid";
312 boost::beast::multi_buffer sb;
313 Json::stream(jvResult, [&sb](
auto const p,
auto const n) {
314 sb.commit(boost::asio::buffer_copy(sb.prepare(n), boost::asio::buffer(p, n)));
316 JLOG(
m_journal.
trace()) <<
"Websocket sending '" << jvResult <<
"'";
330 auto const n = s.length();
331 boost::beast::multi_buffer sb(n);
332 sb.commit(boost::asio::buffer_copy(sb.prepare(n), boost::asio::buffer(s.c_str(), n)));
336 if (postResult ==
nullptr)
339 session->close({boost::beast::websocket::going_away,
"Shutting Down"});
364 using namespace std::chrono_literals;
365 auto const level = [&]() {
367 return journal.
error();
369 return journal.
warn();
370 return journal.
debug();
373 JLOG(level) <<
"RPC request processing duration = "
374 << std::chrono::duration_cast<std::chrono::microseconds>(duration).count()
375 <<
" microseconds. request = " << request;
385 if (is->getConsumer().disconnect(
m_journal))
387 session->close({boost::beast::websocket::policy_error,
"threshold exceeded"});
406 jr[jss::type] = jss::response;
407 jr[jss::status] = jss::error;
409 : jss::missingCommand;
410 jr[jss::request] = jv;
412 jr[jss::id] = jv[jss::id];
414 jr[jss::jsonrpc] = jv[jss::jsonrpc];
416 jr[jss::ripplerpc] = jv[jss::ripplerpc];
418 jr[jss::api_version] = jv[jss::api_version];
453 {is->user(), is->forwarded_for()}};
470 is->getConsumer().charge(loadType);
471 if (is->getConsumer().warn())
472 jr[jss::warning] = jss::load;
479 if (jr[jss::result].isMember(jss::error))
481 jr = jr[jss::result];
482 jr[jss::status] = jss::error;
488 if (rq.isMember(jss::passphrase.c_str()))
489 rq[jss::passphrase.c_str()] =
"<masked>";
490 if (rq.isMember(jss::secret.c_str()))
491 rq[jss::secret.c_str()] =
"<masked>";
492 if (rq.isMember(jss::seed.c_str()))
493 rq[jss::seed.c_str()] =
"<masked>";
494 if (rq.isMember(jss::seed_hex.c_str()))
495 rq[jss::seed_hex.c_str()] =
"<masked>";
498 jr[jss::request] = rq;
502 if (jr[jss::result].isMember(
"forwarded") && jr[jss::result][
"forwarded"])
503 jr = jr[jss::result];
504 jr[jss::status] = jss::success;
508 jr[jss::id] = jv[jss::id];
510 jr[jss::jsonrpc] = jv[jss::jsonrpc];
512 jr[jss::ripplerpc] = jv[jss::ripplerpc];
514 jr[jss::api_version] = jv[jss::api_version];
516 jr[jss::type] = jss::response;
529 session->remoteAddress().at_port(0),
534 auto const iter = session->request().find(
"X-User");
535 if (iter != session->request().end())
536 return iter->value();
537 return boost::beast::string_view{};
546 session->close(
true);
555 sub[
"message"] = std::move(message);
567ServerHandler::processRequest(
576 auto rpcJ = app_.getJournal(
"RPC");
581 if ((request.
size() > RPC::Tuning::maxRequestSize) || !reader.
parse(request, jsonOrig) ||
595 if (jsonOrig.
isMember(jss::method) && jsonOrig[jss::method] ==
"batch")
598 if (!jsonOrig.
isMember(jss::params) || !jsonOrig[jss::params].
isArray())
600 HTTPReply(400,
"Malformed batch request", output, rpcJ);
603 size = jsonOrig[jss::params].
size();
608 for (
unsigned i = 0; i < size; ++i)
615 r[jss::request] = jsonRPC;
621 unsigned apiVersion = RPC::apiVersionIfUnspecified;
623 jsonRPC[jss::params].
size() > 0 && jsonRPC[jss::params][0u].
isObject())
625 apiVersion = RPC::getAPIVersionNumber(
626 jsonRPC[jss::params][
Json::UInt(0)], app_.config().BETA_RPC_API);
629 if (apiVersion == RPC::apiVersionIfUnspecified &&
batch)
632 apiVersion = RPC::getAPIVersionNumber(jsonRPC, app_.config().BETA_RPC_API);
635 if (apiVersion == RPC::apiInvalidVersion)
639 HTTPReply(400, jss::invalid_API_version.c_str(), output, rpcJ);
643 r[jss::request] = jsonRPC;
650 auto role = Role::FORBID;
651 auto required = Role::FORBID;
654 required = RPC::roleRequired(
655 apiVersion, app_.config().BETA_RPC_API, jsonRPC[jss::method].
asString());
662 required, port, jsonRPC[jss::params][
Json::UInt(0)], remoteIPAddress, user);
672 usage = m_resourceManager.newUnlimitedEndpoint(remoteIPAddress);
676 usage = m_resourceManager.newInboundEndpoint(
682 HTTPReply(503,
"Server is overloaded", output, rpcJ);
692 if (role == Role::FORBID)
694 usage.
charge(Resource::feeMalformedRPC);
697 HTTPReply(403,
"Forbidden", output, rpcJ);
706 if (!jsonRPC.
isMember(jss::method) || jsonRPC[jss::method].
isNull())
708 usage.
charge(Resource::feeMalformedRPC);
711 HTTPReply(400,
"Null method", output, rpcJ);
723 usage.
charge(Resource::feeMalformedRPC);
726 HTTPReply(400,
"method is not string", output, rpcJ);
736 if (strMethod.
empty())
738 usage.
charge(Resource::feeMalformedRPC);
741 HTTPReply(400,
"method is empty", output, rpcJ);
759 params = jsonRPC[jss::params];
766 usage.
charge(Resource::feeMalformedRPC);
767 HTTPReply(400,
"params unparsable", output, rpcJ);
772 params = std::move(params[0u]);
775 usage.
charge(Resource::feeMalformedRPC);
776 HTTPReply(400,
"params unparsable", output, rpcJ);
787 if (params.
isMember(jss::ripplerpc))
789 if (!params[jss::ripplerpc].isString())
791 usage.
charge(Resource::feeMalformedRPC);
794 HTTPReply(400,
"ripplerpc is not a string", output, rpcJ);
803 ripplerpc = params[jss::ripplerpc].
asString();
810 if (role != Role::IDENTIFIED && role != Role::PROXY)
816 JLOG(m_journal.debug()) <<
"Query: " << strMethod << params;
819 params[jss::command] = strMethod;
820 JLOG(m_journal.trace()) <<
"doRpcCommand:" << strMethod <<
":" << params;
829 app_.getLedgerMaster(),
843 RPC::doCommand(context, result);
849 JLOG(m_journal.error())
850 <<
"Internal error : " << ex.
what()
861 result[jss::warning] = jss::load;
864 if (ripplerpc >=
"2.0")
868 result[jss::status] = jss::error;
869 result[
"code"] = result[jss::error_code];
870 result[
"message"] = result[jss::error_message];
872 JLOG(m_journal.debug())
873 <<
"rpcError: " << result[jss::error] <<
": " << result[jss::error_message];
874 r[jss::error] = std::move(result);
878 result[jss::status] = jss::success;
879 r[jss::result] = std::move(result);
892 if (rq.isMember(jss::passphrase.c_str()))
893 rq[jss::passphrase.c_str()] =
"<masked>";
894 if (rq.isMember(jss::secret.c_str()))
895 rq[jss::secret.c_str()] =
"<masked>";
896 if (rq.isMember(jss::seed.c_str()))
897 rq[jss::seed.c_str()] =
"<masked>";
898 if (rq.isMember(jss::seed_hex.c_str()))
899 rq[jss::seed_hex.c_str()] =
"<masked>";
902 result[jss::status] = jss::error;
903 result[jss::request] = rq;
905 JLOG(m_journal.debug())
906 <<
"rpcError: " << result[jss::error] <<
": " << result[jss::error_message];
910 result[jss::status] = jss::success;
912 r[jss::result] = std::move(result);
916 r[jss::jsonrpc] = params[jss::jsonrpc];
917 if (params.
isMember(jss::ripplerpc))
918 r[jss::ripplerpc] = params[jss::ripplerpc];
920 r[jss::id] = params[jss::id];
923 reply.
append(std::move(r));
927 reply = std::move(r);
930 if (reply.
isMember(jss::result) && reply[jss::result].
isMember(jss::result))
932 reply = reply[jss::result];
935 reply[jss::result][jss::status] = reply[jss::status];
942 int const httpStatus = [&reply]() {
946 reply[jss::ripplerpc].
asString() >=
"3.0")
949 if (reply.
isMember(jss::error) && reply[jss::error].
isMember(jss::error_code) &&
950 reply[jss::error][jss::error_code].
isInt())
952 int const errCode = reply[jss::error][jss::error_code].
asInt();
953 return RPC::error_code_http_status(
static_cast<error_code_i>(errCode));
960 auto response = to_string(reply);
963 std::chrono::duration_cast<std::chrono::milliseconds>(
970 if (
auto stream = m_journal.debug())
972 static int const maxSize = 10000;
973 if (response.size() <= maxSize)
975 stream <<
"Reply: " << response;
979 stream <<
"Reply: " << response.substr(0, maxSize);
983 HTTPReply(httpStatus, response, output, rpcJ);
995 using namespace boost::beast::http;
997 response<string_body> msg;
999 if (app_.serverOkay(reason))
1001 msg.result(boost::beast::http::status::ok);
1002 msg.body() =
"<!DOCTYPE html><html><head><title>Test page for " + systemName() +
1003 "</title></head><body><h1>Test</h1><p>This page shows " + systemName() +
1004 " http(s) connectivity is working.</p></body></html>";
1008 msg.result(boost::beast::http::status::internal_server_error);
1009 msg.body() =
"<HTML><BODY>Server cannot accept clients: " + reason +
"</BODY></HTML>";
1011 msg.version(request.version());
1012 msg.
insert(
"Server", BuildInfo::getFullVersionString());
1013 msg.insert(
"Content-Type",
"text/html");
1014 msg.insert(
"Connection",
"close");
1015 msg.prepare_payload();
1023ServerHandler::Setup::makeContexts()
1025 for (
auto& p : ports)
1029 if (p.ssl_key.empty() && p.ssl_cert.empty() && p.ssl_chain.empty())
1055 log <<
"Missing 'ip' in [" << p.
name <<
"]";
1056 Throw<std::exception>();
1062 log <<
"Missing 'port' in [" << p.
name <<
"]";
1063 Throw<std::exception>();
1069 log <<
"Missing 'protocol' in [" << p.
name <<
"]";
1070 Throw<std::exception>();
1098 if (!config.
exists(
"server"))
1100 log <<
"Required section [server] is missing";
1101 Throw<std::exception>();
1109 for (
auto const& name : names)
1111 if (!config.
exists(name))
1113 log <<
"Missing section: [" << name <<
"]";
1114 Throw<std::exception>();
1119 if (name == SECTION_PORT_GRPC)
1129 auto it = result.
begin();
1131 while (it != result.
end())
1133 auto& p = it->protocol;
1137 if ((p.erase(
"peer") != 0u) && p.empty())
1139 it = result.
erase(it);
1150 return p.protocol.count(
"peer") != 0;
1155 log <<
"Error: More than one peer protocol configured in [server]";
1156 Throw<std::exception>();
1160 log <<
"Warning: No peer protocol configured";
1170 decltype(setup.
ports)::const_iterator iter;
1171 for (iter = setup.
ports.cbegin(); iter != setup.
ports.cend(); ++iter)
1173 if (iter->protocol.count(
"http") > 0 || iter->protocol.count(
"https") > 0)
1176 if (iter == setup.
ports.cend())
1178 setup.
client.
secure = iter->protocol.count(
"https") > 0;
1182 setup.
client.
ip = iter->ip.is_v6() ?
"::1" :
"127.0.0.1";
1186 setup.
client.
ip = iter->ip.to_string();
1200 return port.protocol.count(
"peer") != 0;
1202 if (iter == setup.
ports.cend())
1207 setup.
overlay = {iter->ip, iter->port};
1225 boost::asio::io_context& io_context,
Decorator for streaming out compact json.
Unserialize a JSON document into a Value.
std::string getFormattedErrorMessages() const
Returns a user friendly string that list errors in the parsed document.
bool parse(std::string const &document, Value &root)
Read a Value from a JSON document.
Value & append(Value const &value)
Append value to array at the end.
UInt size() const
Number of values in array or object.
bool isObjectOrNull() const
Value removeMember(char const *key)
Remove and return the named member.
std::string asString() const
Returns the unquoted string value.
bool isNull() const
isNull() tests to see if this field is null.
bool isMember(char const *key) const
Return true if the object has a member named key.
A version-independent IP address and port combination.
A generic endpoint for log messages.
Stream trace() const
Severity stream access functions.
virtual Config & config()=0
bool exists(std::string const &name) const
Returns true if a section with the given name exists.
Section & section(std::string const &name)
Returns the section with the given name.
Provides the beast::insight::Collector service.
virtual beast::insight::Group::ptr const & group(std::string const &name)=0
A pool of threads to perform work.
std::shared_ptr< Coro > postCoro(JobType t, std::string const &name, F &&f)
Creates a coroutine and adds a job to the queue which will run it.
Provides server functionality for clients.
virtual Handoff onHandoff(std::unique_ptr< stream_type > &&bundle, http_request_type &&request, boost::asio::ip::tcp::endpoint remote_address)=0
Conditionally accept an incoming HTTP request.
An endpoint that consumes resources.
bool warn()
Returns true if the consumer should be warned.
bool disconnect(beast::Journal const &j)
Returns true if the consumer should be disconnected.
Disposition charge(Charge const &fee, std::string const &context={})
Apply a load charge to the consumer.
Tracks load and resource consumption.
std::vector< std::string > const & values() const
Returns all the values in the section.
Resource::Manager & m_resourceManager
std::condition_variable condition_
ServerHandler(ServerHandlerCreator const &, Application &app, boost::asio::io_context &io_context, JobQueue &jobQueue, NetworkOPs &networkOPs, Resource::Manager &resourceManager, CollectorManager &cm)
Handoff onHandoff(Session &session, std::unique_ptr< stream_type > &&bundle, http_request_type &&request, boost::asio::ip::tcp::endpoint const &remote_address)
void onClose(Session &session, boost::system::error_code const &)
Setup const & setup() const
bool onAccept(Session &session, boost::asio::ip::tcp::endpoint endpoint)
beast::insight::Event rpc_size_
Handoff statusResponse(http_request_type const &request) const
void processRequest(Port const &port, std::string const &request, beast::IP::Endpoint const &remoteIPAddress, Output const &, std::shared_ptr< JobQueue::Coro > coro, std::string_view forwardedFor, std::string_view user)
std::map< std::reference_wrapper< Port const >, int > count_
void onRequest(Session &session)
beast::insight::Event rpc_time_
void onWSMessage(std::shared_ptr< WSSession > session, std::vector< boost::asio::const_buffer > const &buffers)
NetworkOPs & m_networkOPs
std::unique_ptr< Server > m_server
beast::insight::Counter rpc_requests_
Json::Value processSession(std::shared_ptr< WSSession > const &session, std::shared_ptr< JobQueue::Coro > const &coro, Json::Value const &jv)
virtual beast::Journal getJournal(std::string const &name)=0
virtual NetworkOPs & getOPs()=0
virtual LedgerMaster & getLedgerMaster()=0
virtual Overlay & getOverlay()=0
Persistent state information for a connection session.
virtual Port const & port()=0
Returns the Port settings for this connection.
virtual void close(bool graceful)=0
Close the session.
virtual std::shared_ptr< Session > detach()=0
Detach the session.
virtual http_request_type & request()=0
Returns the current HTTP request.
virtual std::shared_ptr< WSSession > websocketUpgrade()=0
Convert the connection to WebSocket.
void write(std::string const &s)
Send a copy of data asynchronously.
void stream(Json::Value const &jv, Write const &write)
Stream compact JSON to the specified function.
@ arrayValue
array value (ordered list)
@ objectValue
object value (collection of name/value pairs).
Endpoint from_asio(boost::asio::ip::address const &address)
Convert to Endpoint.
bool is_unspecified(Address const &addr)
Returns true if the address is unspecified.
bool is_keep_alive(boost::beast::http::message< isRequest, Body, Fields > const &m)
std::string const & getFullVersionString()
Full server version string.
static int constexpr maxRequestSize
static constexpr auto apiInvalidVersion
Role roleRequired(unsigned int version, bool betaEnabled, std::string const &method)
Status doCommand(RPC::JsonContext &context, Json::Value &result)
Execute an RPC command and store the results in a Json::Value.
unsigned int getAPIVersionNumber(Json::Value const &jv, bool betaEnabled)
Retrieve the api version number from the json value.
Json::Value make_error(error_code_i code)
Returns a new json object that reflects the error code.
Charge const feeReferenceRPC
Charge const feeMalformedRPC
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
static std::map< std::string, std::string > build_map(boost::beast::http::fields const &h)
void parse_Port(ParsedPort &port, Section const §ion, std::ostream &log)
void HTTPReply(int nStatus, std::string const &strMsg, Json::Output const &, beast::Journal j)
static std::string buffers_to_string(ConstBufferSequence const &bs)
std::string to_string(base_uint< Bits, Tag > const &a)
static void setup_Client(ServerHandler::Setup &setup)
boost::beast::http::request< boost::beast::http::dynamic_body > http_request_type
std::string base64_decode(std::string_view data)
static std::vector< Port > parse_Ports(Config const &config, std::ostream &log)
Json::Int constexpr wrong_version
std::shared_ptr< boost::asio::ssl::context > make_SSLContext(std::string const &cipherList)
Create a self-signed SSL context that allows anonymous Diffie Hellman.
static bool authorized(Port const &port, std::map< std::string, std::string > const &h)
Role requestRole(Role const &required, Port const &port, Json::Value const ¶ms, beast::IP::Endpoint const &remoteIp, std::string_view user)
Return the allowed privilege role.
Resource::Consumer requestInboundEndpoint(Resource::Manager &manager, beast::IP::Endpoint const &remoteAddress, Role const &role, std::string_view user, std::string_view forwardedFor)
static Json::Value make_json_error(Json::Int code, Json::Value &&message)
std::string_view forwardedFor(http_request_type const &request)
static Port to_Port(ParsedPort const &parsed, std::ostream &log)
std::unique_ptr< ServerHandler > make_ServerHandler(Application &app, boost::asio::io_context &io_context, JobQueue &jobQueue, NetworkOPs &networkOPs, Resource::Manager &resourceManager, CollectorManager &cm)
Json::Int constexpr forbidden
Json::Value rpcError(error_code_i iError)
Json::Int constexpr method_not_found
std::unique_ptr< Server > make_Server(Handler &handler, boost::asio::io_context &io_context, beast::Journal journal)
Create the HTTP server using the specified handler.
Json::Int constexpr server_overloaded
void logDuration(Json::Value const &request, T const &duration, beast::Journal &journal)
Overlay::Setup setup_Overlay(BasicConfig const &config)
bool isUnlimited(Role const &role)
ADMIN and IDENTIFIED roles shall have unlimited resources.
std::shared_ptr< boost::asio::ssl::context > make_SSLContextAuthed(std::string const &keyFile, std::string const &certFile, std::string const &chainFile, std::string const &cipherList)
Create an authenticated SSL context using the specified files.
ServerHandler::Setup setup_ServerHandler(Config const &config, std::ostream &log)
static Json::Output makeOutput(Session &session)
static bool isStatusRequest(http_request_type const &request)
static Handoff statusRequestResponse(http_request_type const &request, boost::beast::http::status status)
T remove_suffix(T... args)
static IP::Endpoint from_asio(boost::asio::ip::address const &address)
Used to indicate the result of a server connection handoff.
std::shared_ptr< Writer > response
std::set< std::string, boost::beast::iless > protocol
boost::beast::websocket::permessage_deflate pmd_options
std::optional< boost::asio::ip::address > ip
std::vector< boost::asio::ip::network_v6 > secure_gateway_nets_v6
std::string admin_password
std::vector< boost::asio::ip::network_v4 > secure_gateway_nets_v4
std::uint16_t ws_queue_limit
std::vector< boost::asio::ip::network_v4 > admin_nets_v4
std::optional< std::uint16_t > port
std::vector< boost::asio::ip::network_v6 > admin_nets_v6
Configuration information for a Server listening port.
std::vector< boost::asio::ip::network_v4 > admin_nets_v4
std::string admin_password
std::vector< boost::asio::ip::network_v6 > secure_gateway_nets_v6
std::set< std::string, boost::beast::iless > protocol
boost::beast::websocket::permessage_deflate pmd_options
std::uint16_t ws_queue_limit
boost::asio::ip::address ip
std::vector< boost::asio::ip::network_v4 > secure_gateway_nets_v4
std::vector< boost::asio::ip::network_v6 > admin_nets_v6
std::string admin_password
boost::asio::ip::tcp::endpoint overlay
std::vector< Port > ports