Skip to content

Commit 777eeed

Browse files
committed
feat english readme, feat structure figure
1 parent 76494d0 commit 777eeed

File tree

4 files changed

+185
-38
lines changed

4 files changed

+185
-38
lines changed

.DS_Store

0 Bytes
Binary file not shown.

README-CN.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# 基于Reactor的高性能网络服务器
2+
3+
- **[简体中文](./README-CN.md)**
4+
5+
- **[English](./README.md)**
6+
7+
一个基于多路复用Reactor模式的高性能web服务器,底层实现使用epoll模型。
8+
9+
我将继续更新这个项目,继续改进后端和前端的问题,并创建一个完整的项目。到目前为止,该项目已经完成了最基本的后端建设和简单的前端建设。
10+
11+
**其中,epoll在本项目中的基本原理和多路复用高性能IO的基本原理可以在我的其他repo中看到**
12+
**https://github.com/Yufccode/Multiplexing-high-performance-IO-server**
13+
14+
## 0. Reactor服务器整体结构
15+
16+
![](./figs/0.png)
17+
18+
## 1. 实现效果
19+
20+
21+
**后端效果**
22+
23+
![](./figs/1.png)
24+
25+
在后端可以在`stdout`中看到获取到的http请求报文,当然,我们也可以在日志文件中看到http报文。
26+
27+
**前端效果**
28+
29+
为个人博客展示。
30+
31+
![](./figs/2.png)
32+
33+
## 2. 运行方法
34+
35+
**环境**
36+
37+
- Linux ALiCentos7 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
38+
39+
- gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
40+
41+
克隆该项目。
42+
43+
```bash
44+
git clone https://github.com/Yufccode/Reactor-based-HyperWebServer.git
45+
```
46+
47+
进入该项目的文件夹中。
48+
49+
```bash
50+
cd Reactor-based-HyperWebServer
51+
```
52+
53+
生成可执行。
54+
55+
```bash
56+
make clean;
57+
make;
58+
```
59+
60+
运行服务器。
61+
62+
```
63+
./WebServer
64+
```
65+
66+
注意:如果是云服务器运行本项目需要开放`8080`端口号,否则会因为防火墙而无法访问。
67+
68+
打开浏览器,访问服务端。
69+
70+
一、本机访问
71+
72+
输入url。
73+
74+
```url
75+
127.0.0.1:8080
76+
```
77+
78+
二、云服务器访问。
79+
80+
输入url。
81+
82+
```url
83+
(云服务器ip):8080 # xxx.xxx.xxx.xxx:8080
84+
```
85+
86+
## 3. 文件结构
87+
88+
```bash
89+
yufc@ALiCentos7:~/Src/Bit-Project/WebServer-reactor$ tree .
90+
.
91+
├── CleanLogs.sh # 清除所有日志文件内容脚本
92+
├── Logs
93+
│ ├── Requests.log # 收到HTTP报文保存的日志文件
94+
│ └── WebServer.log # 服务器打印的日志保存文件
95+
├── makefile
96+
├── Reactor # Reactor模式底层服务器文件
97+
│ ├── Epoll.hpp
98+
│ ├── Log.hpp
99+
│ ├── Protocol.hpp
100+
│ ├── Reactor-server.hpp
101+
│ └── Sock.hpp
102+
├── README.md
103+
├── start-main.cc
104+
├── text
105+
│ └── ziliao.txt # 资料
106+
├── tools
107+
│ ├── main.cc-backup # main函数备份
108+
│ └── ulity.hpp # 工具相关接口头文件
109+
├── WebServer # 可执行程序
110+
├── WebServer.hpp # Web服务器头文件
111+
├── wwwroot # 前端根目录
112+
│ ├── error
113+
│ │ └── 404.html
114+
│ └── index.html
115+
└── wwwroot-backup # 前端根目录的一些备份
116+
├── my_blog_root
117+
│ └── index.html
118+
└── wwwroot
119+
├── error
120+
│ └── 404.html
121+
└── index.html
122+
123+
10 directories, 21 files
124+
yufc@ALiCentos7:~/Src/Bit-Project/WebServer-reactor$
125+
```
126+
127+
## 4. 项目原理简介
128+
129+
本项目基于Socker编程,采用epoll形式的多路转接,搭建了一个Reactor模式的网络服务器。
130+
131+
其中`WebServer.hpp`为底层`Reactor`服务器的封装。
132+
133+
本项目其实是Nginx服务器的核心所在。
134+
135+
关于Nginx等实现原理,异步IO的原理,多路转接的原理,可以见以下链接。
136+
137+
- **[中文-introduction](./introduction-cn.md)**
138+
139+
- **[English-introduction](./introduction.md)**

README.md

Lines changed: 46 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,99 @@
11
# 基于Reactor的高性能网络服务器
22

3-
一个基于多路复用Reactor模式的高性能web服务器,底层实现使用epoll模型。
3+
- **[简体中文](./README-CN.md)**
44

5-
我将继续更新这个项目,继续改进后端和前端的问题,并创建一个完整的项目。到目前为止,该项目已经完成了最基本的后端建设和简单的前端建设。
5+
- **[English](./README.md)**
66

7-
**其中,epoll在本项目中的基本原理和多路复用高性能IO的基本原理可以在我的其他repo中看到**
7+
A high-performance web server based on the multiplexed Reactor pattern, with the underlying implementation using the epoll model.
8+
9+
I will continue to update this project, improve the backend and front-end issues, and create a complete project. So far, the project has completed the most basic backend construction and simple frontend construction.
10+
11+
**Among them, the basic principles of epoll in this project and the basic principles of multiplexing high-performance IO can be seen in my other repo:**
812
**https://github.com/Yufccode/Multiplexing-high-performance-IO-server**
913

10-
## 1. 实现效果
14+
## 0. Overall structure of Reactor server
15+
16+
![](./figs/0.png)
17+
18+
## 1. Implementation effect
1119

1220

13-
**后端效果**
21+
**Backend effects**
1422

15-
![](./figs/1.png)
23+
![](./figs/1.png)Backend effects
1624

17-
在后端可以在`stdout`中看到获取到的http请求报文,当然,我们也可以在日志文件中看到http报文。
25+
In the backend, we can see the obtained HTTP request message in 'stdout', and of course, we can also see the HTTP message in the log file.
1826

19-
**前端效果**
27+
**Front end effects**
2028

21-
为个人博客展示。
29+
Display for personal blog.
2230

2331
![](./figs/2.png)
2432

25-
## 2. 运行方法
33+
## 2. operating method
2634

27-
**环境**
35+
**Env**
2836

2937
- Linux ALiCentos7 3.10.0-1160.88.1.el7.x86_64 #1 SMP Tue Mar 7 15:41:52 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
3038

3139
- gcc (GCC) 8.3.1 20190311 (Red Hat 8.3.1-3)
3240

33-
克隆该项目。
41+
clone from github.
3442

3543
```bash
3644
git clone https://github.com/Yufccode/Reactor-based-HyperWebServer.git
3745
```
3846

39-
进入该项目的文件夹中。
47+
enter the dir.
4048

4149
```bash
4250
cd Reactor-based-HyperWebServer
4351
```
4452

45-
生成可执行。
53+
make.
4654

4755
```bash
4856
make clean;
4957
make;
5058
```
5159

52-
运行服务器。
60+
start the sever.
5361

5462
```
5563
./WebServer
5664
```
5765

58-
注意:如果是云服务器运行本项目需要开放`8080`端口号,否则会因为防火墙而无法访问。
66+
Note: If running this project on a cloud server, the '8080' port number needs to be opened, otherwise it may be inaccessible due to the firewall.
5967

60-
打开浏览器,访问服务端。
68+
Open the browser and access the server.
6169

62-
一、本机访问
70+
**Local Access**
6371

64-
输入url
72+
enter the url
6573

6674
```url
6775
127.0.0.1:8080
6876
```
6977

70-
二、云服务器访问。
78+
**other machines access**
7179

72-
输入url。
80+
enter the url.
7381

7482
```url
75-
(云服务器ip):8080 # xxx.xxx.xxx.xxx:8080
83+
(server ip):8080 # xxx.xxx.xxx.xxx:8080
7684
```
7785

78-
## 3. 文件结构
86+
## 3. File Structure
7987

8088
```bash
8189
yufc@ALiCentos7:~/Src/Bit-Project/WebServer-reactor$ tree .
8290
.
83-
├── CleanLogs.sh # 清除所有日志文件内容脚本
91+
├── CleanLogs.sh # Clear all log file content scripts
8492
├── Logs
85-
│ ├── Requests.log # 收到HTTP报文保存的日志文件
86-
│ └── WebServer.log # 服务器打印的日志保存文件
93+
│ ├── Requests.log # Received the log file saved in the HTTP message
94+
│ └── WebServer.log # Server printed log save file
8795
├── makefile
88-
├── Reactor # Reactor模式底层服务器文件
96+
├── Reactor # Reactor pattern underlying server files
8997
│ ├── Epoll.hpp
9098
│ ├── Log.hpp
9199
│ ├── Protocol.hpp
@@ -94,17 +102,17 @@ yufc@ALiCentos7:~/Src/Bit-Project/WebServer-reactor$ tree .
94102
├── README.md
95103
├── start-main.cc
96104
├── text
97-
│ └── ziliao.txt # 资料
105+
│ └── ziliao.txt # some Reactor pattern underlying server files
98106
├── tools
99-
│ ├── main.cc-backup # main函数备份
100-
│ └── ulity.hpp # 工具相关接口头文件
101-
├── WebServer # 可执行程序
102-
├── WebServer.hpp # Web服务器头文件
103-
├── wwwroot # 前端根目录
107+
│ ├── main.cc-backup # main function backup
108+
│ └── ulity.hpp # Tool related interface header files
109+
├── WebServer # executable program
110+
├── WebServer.hpp # Web server header file
111+
├── wwwroot # Front end root directory
104112
│ ├── error
105113
│ │ └── 404.html
106114
│ └── index.html
107-
└── wwwroot-backup # 前端根目录的一些备份
115+
└── wwwroot-backup # Front end root directory backup
108116
├── my_blog_root
109117
│ └── index.html
110118
└── wwwroot
@@ -118,13 +126,13 @@ yufc@ALiCentos7:~/Src/Bit-Project/WebServer-reactor$
118126

119127
## 4. 项目原理简介
120128

121-
本项目基于Socker编程,采用epoll形式的多路转接,搭建了一个Reactor模式的网络服务器。
129+
This project is based on Docker programming and uses epoll form of multiplexing to build a Reactor mode network server.
122130

123-
其中`WebServer.hpp`为底层`Reactor`服务器的封装。
131+
Among them, 'WebServer. hpp' is the encapsulation of the underlying 'Reactor' server.
124132

125-
本项目其实是Nginx服务器的核心所在。
133+
This project is actually the core of Nginx server.
126134

127-
关于Nginx等实现原理,异步IO的原理,多路转接的原理,可以见以下链接。
135+
For the implementation principles of Nginx, asynchronous IO, and multiplexing, please refer to the following links.
128136

129137
- **[中文-introduction](./introduction-cn.md)**
130138

figs/0.png

208 KB
Loading

0 commit comments

Comments
 (0)