From 70758cada33bf29981c3952350efbd581823b8a7 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Fri, 31 May 2019 15:17:52 +0800 Subject: [PATCH] 1 --- server/wsproxy/target_conn_mgr.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/server/wsproxy/target_conn_mgr.cc b/server/wsproxy/target_conn_mgr.cc index 339728e..4edd198 100644 --- a/server/wsproxy/target_conn_mgr.cc +++ b/server/wsproxy/target_conn_mgr.cc @@ -3,6 +3,7 @@ #include "target_conn_mgr.h" #include "target_conn.h" #include "jsondatamgr.h" +#include "app.h" void TargetConnMgr::Init() { @@ -14,12 +15,18 @@ void TargetConnMgr::Init() int instance_id = target_server_conf->At("instance_id")->AsXValue(); std::string remote_ip = target_server_conf->At("ip")->AsXValue(); int remote_port = target_server_conf->At("port")->AsXValue(); + if (App::Instance()->HasFlag(3)) { + remote_ip = "127.0.0.1"; + } { TargetConn* conn = new TargetConn(); conn->Init(instance_id, remote_ip, remote_port); id_hash_[conn->instance_id] = conn; conn->Open(); } + if (App::Instance()->HasFlag(3)) { + break; + } } #endif }