Skip to content

Commit 47e6484

Browse files
committed
Add monitor URL option to proxy server
1 parent a549105 commit 47e6484

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

proxy/include/proxy/proxy_session.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,12 @@ namespace proxy {
229229
// - 为空表示不启用该功能。
230230
std::string stdio_target_;
231231

232+
// 监控 URL 用于指定 proxy server 的监控接口 URL。
233+
//
234+
// - 为空表示不启用监控功能。
235+
// - 否则,将使用指定的 URL 进行监控。
236+
std::string monitor_url_;
237+
232238
// PAM 认证服务配置名称。
233239
//
234240
// - 为空表示不启用 PAM 认证。

server/proxy_server/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ int udp_timeout;
101101
int rate_limit;
102102

103103
std::string asio_config;
104+
std::string monitor_url;
104105

105106
//////////////////////////////////////////////////////////////////////////
106107

@@ -302,6 +303,7 @@ start_proxy_server(net::io_context& ioc, server_ptr& server)
302303
opt.htpasswd_ = htpasswd;
303304
if (!dns_upstream.empty())
304305
opt.dns_upstream_ = dns_upstream;
306+
opt.monitor_url_ = monitor_url;
305307

306308
server = proxy_server::make(ioc.get_executor(), opt);
307309
server->start();
@@ -470,6 +472,7 @@ int main(int argc, char** argv)
470472
("noise_length", po::value<int64_t>(&noise_length)->value_name("length")->default_value(-1), "Length of the noise data in bytes (-1 = disable, 0-4095).")
471473

472474
("asio_config", po::value<std::string>(&asio_config)->value_name("enable asio config env")->default_value("ASIO"), "Environment variable name for configuring Boost.Asio (default: ASIO).")
475+
("monitor_url", po::value<std::string>(&monitor_url)->value_name("monitor url")->default_value(""), "Specify the monitor URL for the proxy server.")
473476
;
474477

475478
// 解析命令行.

0 commit comments

Comments
 (0)