Commit 65c540b2 authored by Peter Jankuliak's avatar Peter Jankuliak
Browse files

ClientConfig: set default value for front-end

parent 954f915f
......@@ -1739,6 +1739,9 @@ void Client::State::serve_request( GenericStream&& con
Match( reqexpr::from_regex(host_getter, "localhost")
, {deque<fresh_channel>({fresh_channel::_front_end})} ),
Match( reqexpr::from_regex(host_getter, util::str(_config.front_end_endpoint()))
, {deque<fresh_channel>({fresh_channel::_front_end})} ),
Match( reqexpr::from_regex(x_oui_dest_getter, "OuiClient")
, {deque<fresh_channel>({fresh_channel::_front_end})} ),
......
......@@ -109,7 +109,7 @@ public:
// Client options
("listen-on-tcp", po::value<string>(), "IP:PORT endpoint on which we'll listen")
("front-end-ep"
, po::value<string>()
, po::value<string>()->default_value("127.0.0.137:8081")
, "Front-end's endpoint (in <IP>:<PORT> format)")
("tls-ca-cert-store-path", po::value<string>(&_tls_ca_cert_store_path)
, "Path to the CA certificate store file")
......@@ -306,14 +306,16 @@ ClientConfig::ClientConfig(int argc, char* argv[])
if (vm.count("front-end-ep")) {
auto ep_str = vm["front-end-ep"].as<string>();
if (!ep_str.empty()) {
sys::error_code ec;
_front_end_endpoint = parse::endpoint<asio::ip::tcp>(ep_str, ec);
if (ep_str.empty()) {
throw std::runtime_error("--front-end-ep must not be empty");
}
if (ec) {
throw std::runtime_error( "Failed to parse endpoint \""
+ ep_str + "\"");
}
sys::error_code ec;
_front_end_endpoint = parse::endpoint<asio::ip::tcp>(ep_str, ec);
if (ec) {
throw std::runtime_error( "Failed to parse endpoint \""
+ ep_str + "\"");
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment