Echo Web Server
1.0.0
在Linux上运行的C ++ 20 Echo Web服务器。
如果用户输入名称<user>和消息<msg> ,则服务器将用<user> said "<msg>"回复。
将位置设置为项目文件夹并运行:
docker image build . -t < image > <image>应替换为自定义Docker图像名称。
docker container run < image > ctest --test-dir .. -VVconfig.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 。如果要更改Logger配置,请参见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 。