Linux 에서 실행되는 C ++ 20 Echo 웹 서버.
사용자가 이름 <user> 및 <msg> 메시지를 입력하면 <user> said "<msg>" 로 답장을합니다.
위치를 프로젝트 폴더로 설정하고 실행하십시오.
docker image build . -t < image > <image> 사용자 정의 Docker 이미지 이름으로 대체되어야합니다.
docker container run < image > ctest --test-dir .. -VV config.yaml 은 기본 구성입니다. 건물 중에 Docker 에게 복사됩니다.
server :
# The TCP listening port.
port : 10000
# The website folder.
asset_folder : " assets "
# The maximum alive time for client timers (in seconds).
# When a client's timer reaches zero and it has no activity, it will disconnect.
alive_time : 60
loggers :
- name : root
level : info
appenders :
- type : stdout새로운 구성을 효과적으로 만드는 두 가지 방법이 있습니다.
config.yaml 변경하고 새 Docker 이미지를 작성하십시오.build/bin/config.yaml 변경하십시오. 로거 구성을 변경하려면 자세한 내용은 src/log/README.md 참조하십시오.
docker container run -p < container-port > : < host-port > < image > <container-port> config.yaml 의 server.port 와 같아야합니다. <host-port> 호스트 머신의 사용 가능한 포트가 될 수 있습니다. -p <container-port>:<host-port> 컨테이너의 <container-port> 호스트 머신의 <host-port> 에 바인딩합니다.
서버가 실행되면 브라우저를 열고 호스트 시스템에서 http://localhost:<host-port> 액세스하여 사용합니다.
다음 명령을 실행하고 기본 구성을 사용하는 경우 http://localhost:10000 에 액세스 할 수 있습니다.
docker container run -p 10000:10000 < image > 단위 테스트는 공개 및 개인 테스트로 구성된 Googletest 프레임 워크를 사용하여 수행합니다.
tests 폴더에 있습니다. 단위 테스트 파일의 이름은 _test 로 끝납니다.
코드 주석 스타일은 Doxygen 사양을 따릅니다.
클래스 다이어그램은 인어 사양을 따릅니다.
.
├── CITATION.cff
├── CMakeLists.txt
├── Dockerfile
├── LICENSE
├── README.md
├── .github
│ └── workflows
│ └── cmake-googletest.yaml
├── assets
│ ├── favicon.ico
│ ├── http-status.html
│ └── index.html
├── config.yaml
├── docs
│ └── badges
│ ├── C++.svg
│ ├── License-MIT.svg
│ ├── Linux.svg
│ ├── Made-with-CMake.svg
│ ├── Made-with-GitHub-Actions.svg
│ └── Made-with-Docker.svg
├── include
│ ├── config.h
│ ├── containers
│ │ ├── block_deque.h
│ │ ├── buffer.h
│ │ ├── epoller.h
│ │ ├── heap_timer.h
│ │ └── thread_pool.h
│ ├── http.h
│ ├── io.h
│ ├── ip.h
│ ├── log.h
│ ├── test_util.h
│ ├── util.h
│ └── web_server.h
├── src
│ ├── CMakeLists.txt
│ ├── config
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── config.cpp
│ ├── containers
│ │ ├── CMakeLists.txt
│ │ ├── buffer
│ │ │ ├── CMakeLists.txt
│ │ │ ├── README.md
│ │ │ └── buffer.cpp
│ │ ├── epoller
│ │ │ ├── CMakeLists.txt
│ │ │ └── epoller.cpp
│ │ └── thread_pool
│ │ ├── CMakeLists.txt
│ │ └── thread_pool.cpp
│ ├── http
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ ├── http.cpp
│ │ ├── request.cpp
│ │ ├── request.h
│ │ ├── request_test.cpp
│ │ ├── response.cpp
│ │ ├── response.h
│ │ └── response_test.cpp
│ ├── io
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── io.cpp
│ ├── ip
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ └── ip.cpp
│ ├── log
│ │ ├── CMakeLists.txt
│ │ ├── README.md
│ │ ├── appender.cpp
│ │ ├── config_init.cpp
│ │ ├── config_init.h
│ │ ├── config_init_test.cpp
│ │ ├── field.cpp
│ │ ├── field.h
│ │ ├── field_test.cpp
│ │ └── log.cpp
│ ├── main.cpp
│ ├── test_util
│ │ ├── CMakeLists.txt
│ │ └── test_util.cpp
│ └── util
│ ├── CMakeLists.txt
│ └── util.cpp
└── tests
├── CMakeLists.txt
├── config_test.cpp
├── containers
│ ├── block_deque_test.cpp
│ ├── buffer_test.cpp
│ ├── heap_timer_test.cpp
│ └── thread_pool_test.cpp
├── http_test.cpp
├── io_test.cpp
├── ip_test.cpp
├── log_test.cpp
└── util_test.cpp
MIT 라이센스 에 따라 배포됩니다. 자세한 내용은 LICENSE 참조하십시오.