从源码安装
前置条件
- Go 1.21 或更高版本
- 可通过 WebSocket 访问的 UKey 硬件
克隆源码
请先从源码仓库,克隆源码
源码仓库
- 国内 Gitee https://gitee.com/ledc/iyuunet
- 国际 GitHub https://github.com/ledccn/iyuunet
bash
git clone https://github.com/ledccn/iyuunet.git && cd iyuunet
构建二进制文件
bash
go mod download
go build -o chinaport-proxy
bash
make build # 构建二进制文件
make build-all # 为所有平台构建(Linux、Windows、macOS)
make install # 安装到 $GOPATH/bin
使用方法
启动服务器
bash
# 使用默认 config.json
./chinaport-proxy
# 使用自定义配置文件
./chinaport-proxy -config /path/to/config.json
bash
make run # 使用默认 config.json 构建并运行
CONFIG=prod.json make run-config # 使用自定义配置文件构建并运行
make dev # 使用竞态检测器运行(开发模式)