Skip to content

Commit 649ad25

Browse files
committed
doc(gt): update
ci(gt): update
1 parent 7929548 commit 649ad25

File tree

5 files changed

+92
-133
lines changed

5 files changed

+92
-133
lines changed

.github/workflows/container.yml

+1-6
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,7 @@ jobs:
4242
run: |-
4343
sudo apt-get update && sudo apt-get install make git gn ninja-build python3 python3-pip libgtk-3-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-x86-64-linux-gnu g++-x86-64-linux-gnu gcc-riscv64-linux-gnu g++-riscv64-linux-gnu rustc upx -y
4444
rustup target add x86_64-unknown-linux-gnu aarch64-unknown-linux-gnu riscv64gc-unknown-linux-gnu
45-
make linux
46-
mkdir -p release
47-
cp target/x86_64-unknown-linux-gnu/release/gt release/linux-x86_64-gt
48-
cp target/aarch64-unknown-linux-gnu/release/gt release/linux-aarch64-gt
49-
upx release/*
50-
cp target/riscv64gc-unknown-linux-gnu/release/gt release/linux-riscv64-gt
45+
make
5146
5247
- name: Archive GT artifacts
5348
uses: actions/upload-artifact@v3

Dockerfile-client

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@ ENV TZ=Asia/Shanghai
2323
RUN apt update && DEBIAN_FRONTEND=noninteractive TZ=Asia/Shanghai apt-get -y install tzdata ca-certificates && rm -rf /var/lib/apt/lists/*
2424

2525
COPY release/* /
26-
RUN cp /linux-`arch`-gt /usr/bin/gt && ln -s /usr/bin/gt /usr/bin/client && rm -f /*-gt
26+
RUN cp /gt-linux-`arch` /usr/bin/gt && ln -s /usr/bin/gt /usr/bin/client && rm -f /*-gt
2727

2828
ENTRYPOINT ["/usr/bin/gt", "client", "-c", "/opt/config/aonetwork-client.yml"]

Dockerfile-server

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ENV TZ=Asia/Shanghai
2323
RUN apt update && DEBIAN_FRONTEND=noninteractive TZ=Asia/Shanghai apt-get -y install tzdata ca-certificates && rm -rf /var/lib/apt/lists/*
2424

2525
COPY release/* /
26-
RUN cp /linux-`arch`-gt /usr/bin/gt && rm -f /*-gt
26+
RUN cp /gt-linux-`arch` /usr/bin/gt && rm -f /*-gt
2727
COPY entrypoint-server.sh /opt/entrypoint.sh
2828
RUN chmod +x /opt/entrypoint.sh
2929

Makefile

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,39 @@
1+
ifeq ($(OS),Windows_NT)
2+
detected_os := Windows
3+
else
4+
detected_os := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
5+
endif
6+
7+
ifeq ($(detected_os),Windows)
8+
make_param := windows
9+
endif
10+
ifeq ($(detected_os),Darwin)
11+
make_param := darwin
12+
endif
13+
ifeq ($(detected_os),Linux)
14+
make_param := linux
15+
endif
16+
17+
all:
18+
make $(make_param)
19+
120
linux:
221
cd ./libcs && TARGET=aarch64-linux-gnu GOOS=linux GOARCH=arm64 make release_lib
322
cargo build --target aarch64-unknown-linux-gnu -r
423
cd ./libcs && TARGET=x86_64-linux-gnu GOOS=linux GOARCH=amd64 make release_lib
524
cargo build --target x86_64-unknown-linux-gnu -r
625
cd ./libcs && TARGET=riscv64-linux-gnu GOOS=linux GOARCH=riscv64 make release_lib
726
cargo build --target riscv64gc-unknown-linux-gnu -r
27+
mkdir -p release
28+
cp target/x86_64-unknown-linux-gnu/release/gt release/gt-linux-x86_64
29+
cp target/aarch64-unknown-linux-gnu/release/gt release/gt-linux-aarch64
30+
cp target/riscv64gc-unknown-linux-gnu/release/gt release/gt-linux-riscv64
831

9-
mac:
32+
darwin:
1033
cd ./libcs && TARGET=aarch64-apple-darwin GOOS=darwin GOARCH=arm64 arch -arch arm64 make release_lib
1134
cargo build --target aarch64-apple-darwin -r
1235
cd ./libcs && TARGET=x86_64-apple-darwin GOOS=darwin GOARCH=amd64 arch -arch x86_64 make release_lib
1336
cargo build --target x86_64-apple-darwin -r
37+
mkdir -p release
38+
cp target/aarch64-apple-darwin/release/gt release/gt-darwin-x86_64
39+
cp targetx86_64-apple-darwin/release/gt release/gt-darwin-aarch64

README.md

+62-124
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ GT 是一个高性能的 WebSocket(s)/HTTP(s)/TCP 中转代理。
66

77
具有以下设计特点:
88
- 多进程+多线程架构
9-
- reload 过程中,保持转发可以成功。压力测试过程中 reload, 测试结果 0 error
9+
- reload 过程中,保持转发可以成功。压力测试过程中 reload,测试结果 0 error
1010
- 进程守护,工作进程崩溃自动重启
1111
- 加载配置文件目录,可以同时启动多个服务端,客户端
1212
- 注重性能,在保持跨平台和功能稳定的前提下,会尝试采用性能更高的技术方案
@@ -44,6 +44,22 @@ GT 是一个高性能的 WebSocket(s)/HTTP(s)/TCP 中转代理。
4444
└─────────────┘ └─────────────┘ └─────────────┘
4545
```
4646

47+
## 下载
48+
49+
### Github
50+
51+
<https://github.com/ao-space/gt/releases> 选择合适的版本下载。
52+
53+
### Docker 容器
54+
55+
更多容器镜像信息可以从 <https://github.com/ao-space/gt/pkgs/container/gt> 获取。
56+
57+
```shell
58+
docker pull ghcr.io/ao-space/gt:server-dev
59+
60+
docker pull ghcr.io/ao-space/gt:client-dev
61+
```
62+
4763
## 用法
4864

4965
```shell
@@ -59,7 +75,7 @@ Commands:
5975

6076
Options:
6177
-c, --config <CONFIG>
62-
Path to the config file or the directory containing the config files
78+
Path to the config file or the directory contains the config files
6379

6480
-s, --signal <SIGNAL>
6581
Send signal to the running GT processes
@@ -76,6 +92,46 @@ Options:
7692
Print version
7793
```
7894

95+
### 配置文件
96+
97+
配置文件可以通过 Web 管理后台编辑生成,推荐直接使用 Web 管理后台编辑。
98+
99+
### 服务端
100+
101+
使用默认配置运行,运行后可从日志获取 Web 管理后台地址,用浏览器打开后,进行配置项编辑:
102+
103+
```shell
104+
gt server
105+
```
106+
107+
通过指定配置文件运行:
108+
109+
```shell
110+
gt server -c ./config.yml
111+
```
112+
113+
### 客户端
114+
115+
使用默认配置运行,运行后可从日志获取 Web 管理后台地址,用浏览器打开后,进行配置项编辑:
116+
117+
```shell
118+
gt client
119+
```
120+
121+
通过指定配置文件运行:
122+
123+
```shell
124+
gt client -c ./config.yml
125+
```
126+
127+
### 批量启动
128+
129+
通过指定配置文件目录批量启动:
130+
131+
```shell
132+
gt -c ./conf.d
133+
```
134+
79135
## 性能测试
80136

81137
### 第一组(MacOS环境+nginx测试)
@@ -246,127 +302,9 @@ Requests/sec: 41334.52
246302
Transfer/sec: 5.09MB
247303
```
248304

249-
## 运行
250-
251-
### Docker 容器运行
252-
253-
更多容器镜像信息可以从<https://github.com/ao-space/gt/pkgs/container/gt>获取。
254-
255-
```shell
256-
docker pull ghcr.io/ao-space/gt:server-dev
257-
258-
docker pull ghcr.io/ao-space/gt:client-dev
259-
```
260-
261-
## 编译
262-
263-
### 在 Ubuntu/Debian 上编译
264-
265-
#### 安装依赖
266-
267-
```shell
268-
apt-get update
269-
apt-get install make git gn ninja-build python3 python3-pip libgtk-3-dev gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-x86-64-linux-gnu g++-x86-64-linux-gnu -y
270-
```
271-
272-
#### 获取代码并编译
273-
274-
你可以选择从镜像或者官方获取 WebRTC 并编译 GT:
275-
276-
##### 从 ISCAS 镜像获取 WebRTC 并编译 GT
277-
278-
1. 获取代码
279-
280-
```shell
281-
git clone <url>
282-
cd <folder>
283-
```
284-
285-
2. 编译
286-
287-
```shell
288-
make release
289-
```
290-
291-
编译后的可执行文件在 release 目录下。
292-
293-
##### 从官方获取 WebRTC 并编译 GT
294-
295-
1. 获取代码
296-
297-
```shell
298-
git clone <url>
299-
cd <folder>
300-
```
301-
302-
2. 从官方获取 WebRTC
303-
304-
```shell
305-
mkdir -p dep/_google-webrtc
306-
cd dep/_google-webrtc
307-
git clone https://webrtc.googlesource.com/src
308-
```
309-
310-
然后按照[这个链接中的步骤](https://webrtc.googlesource.com/src/+/main/docs/native-code/development/)检出构建工具链和许多依赖项。
311-
312-
3. 编译
313-
314-
```shell
315-
WITH_OFFICIAL_WEBRTC=1 make release
316-
```
317-
318-
编译后的可执行文件在 release 目录下。
319-
320-
### 在 Ubuntu/Debian 上通过 Docker 编译
321-
322-
#### 安装依赖
323-
324-
[安装 Docker](https://docs.docker.com/engine/install/)
325-
326-
#### 获取代码并编译
327-
328-
你可以选择从镜像或者官方获取 WebRTC 并编译 GT:
329-
330-
##### 从 ISCAS 镜像获取 WebRTC 并编译 GT
331-
332-
1. 获取代码
333-
334-
```shell
335-
git clone <url>
336-
cd <folder>
337-
```
338-
339-
2. 编译
340-
341-
```shell
342-
make docker_release_linux_amd64 # docker_release_linux_arm64
343-
```
344-
345-
编译后的可执行文件在 release 目录下。
346-
347-
##### 从官方获取 WebRTC 并编译 GT
348-
349-
1. 获取代码
350-
351-
```shell
352-
git clone <url>
353-
cd <folder>
354-
```
355-
356-
2. 从官方获取 WebRTC
357-
358-
```shell
359-
mkdir -p dep/_google-webrtc
360-
cd dep/_google-webrtc
361-
git clone https://webrtc.googlesource.com/src
362-
```
363-
364-
然后按照[这个链接中的步骤](https://webrtc.googlesource.com/src/+/main/docs/native-code/development/)检出构建工具链和许多依赖项。
365-
366-
3. 编译
305+
## 贡献者
367306

368-
```shell
369-
WITH_OFFICIAL_WEBRTC=1 make docker_release_linux_amd64 # docker_release_linux_arm64
370-
```
307+
感谢以下人员为项目做出的贡献:
371308

372-
编译后的可执行文件在 release 目录下。
309+
- [zhiyi](https://github.com/vyloy)
310+
- [jianti](https://github.com/FH0)

0 commit comments

Comments
 (0)