- // put in frontend first
- yp2::FilterFrontendNet filter_front;
- filter_front.listen_address() = "tcp:@:9999";
- //filter_front.listen_duration() = 1; // listen a short time only
- router.rule(filter_front);
+ // put frontend filter in router
+ yp2::filter::FrontendNet filter_front;
+ filter_front.ports() = ports;
+
+ // 0=no time, >0 timeout in seconds
+ if (vm.count("duration")) {
+ filter_front.listen_duration() = vm["duration"].as<int>();
+ }
+ router.append(filter_front);
+
+ // put log filter in router
+ yp2::filter::Log filter_log_front("FRONT");
+ router.append(filter_log_front);
+
+ // put Virt db filter in router
+ yp2::filter::Virt_db filter_virt_db;
+ filter_virt_db.add_map_db2vhost("gils", "indexdata.dk/gils",
+ "");
+ filter_virt_db.add_map_db2vhost("Default", "localhost:9999/Default",
+ "");
+ filter_virt_db.add_map_db2vhost("2", "localhost:9999/2", "");
+ router.append(filter_virt_db);
+
+ yp2::filter::SessionShared filter_session_shared;
+ //router.append(filter_session_shared);
+
+ yp2::filter::Log filter_log_back("BACK");
+ router.append(filter_log_back);
+
+ // put HTTP backend filter in router
+ HTTPFilter filter_init;
+ router.append(filter_init);