From eeb2bbc0fcc9c5afa2c3aa12915b4d3f31115e56 Mon Sep 17 00:00:00 2001 From: moneromooo-monero Date: Wed, 7 Sep 2016 21:38:41 +0100 Subject: epee: optionally restrict HTTP service to a configurable user agent This is intended to catch traffic coming from a web browser, so we avoid issues with a web page sending a transfer RPC to the wallet. Requiring a particular user agent can act as a simple password scheme, while we wait for 0MQ and proper authentication to be merged. --- src/daemon/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/daemon/main.cpp') diff --git a/src/daemon/main.cpp b/src/daemon/main.cpp index 93027a5d6..0895e1bf1 100644 --- a/src/daemon/main.cpp +++ b/src/daemon/main.cpp @@ -208,6 +208,7 @@ int main(int argc, char const * argv[]) { rpc_port_str = command_line::get_arg(vm, cryptonote::core_rpc_server::arg_testnet_rpc_bind_port); } + auto user_agent = command_line::get_arg(vm, cryptonote::core_rpc_server::arg_user_agent); uint32_t rpc_ip; uint16_t rpc_port; @@ -222,7 +223,7 @@ int main(int argc, char const * argv[]) return 1; } - daemonize::t_command_server rpc_commands{rpc_ip, rpc_port}; + daemonize::t_command_server rpc_commands{rpc_ip, rpc_port, user_agent}; if (rpc_commands.process_command_vec(command)) { return 0; -- cgit v1.2.3