feat: docker 이용한 서버 실행 및 사용 설명 추가, 환경변수 이용한 주소
처리 추가
This commit is contained in:
parent
f108967cc7
commit
ad5c01fd86
6 changed files with 85 additions and 14 deletions
|
|
@ -18,6 +18,11 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
try {
|
||||
boost::asio::io_context io_context;
|
||||
const char *env_host = std::getenv("SERVER_HOST");
|
||||
const char *env_port = std::getenv("SERVER_PORT");
|
||||
std::string host = env_host ? env_host : "127.0.0.1";
|
||||
std::string port = env_port ? env_port : "30000";
|
||||
|
||||
if (isScenario) {
|
||||
if (scenarioFile.empty()) {
|
||||
std::cerr
|
||||
|
|
@ -25,10 +30,10 @@ int main(int argc, char *argv[]) {
|
|||
<< std::endl;
|
||||
return 1;
|
||||
}
|
||||
ScenarioClient client(io_context, "127.0.0.1", "30000", scenarioFile);
|
||||
ScenarioClient client(io_context, host, port, scenarioFile);
|
||||
client.Run();
|
||||
} else {
|
||||
InteractiveClient client(io_context, "127.0.0.1", "30000");
|
||||
InteractiveClient client(io_context, host, port);
|
||||
client.Run();
|
||||
}
|
||||
} catch (std::exception &e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue