diff --git a/README.md b/README.md index a445b2fc1f80be151519a8077998e0244e0475b2..c670fe2e06721259de5c9cd35df6c259b690a83c 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # curl-rust -#### 介绍 +## 介绍 cURL 提供了curl(命令行工具)和 libcurl(C语言的API库),两者功能均是基于网络协议,对指定 URL 进行网络传输。cURL 使用C语言实现,libcurl 历史安全漏洞较多,其中内存类占比51%。本项目通过使用 Rust 重写 cURL 的高危模块,利用 Rust 语言的内存安全优势,以增加 libcurl 的安全性和可靠性。 -#### 项目实施方案 +## 项目实施方案 对 cURL 的改写,分为以下步骤进行: @@ -14,10 +14,29 @@ cURL 提供了curl(命令行工具)和 libcurl(C语言的API库),两 - 改写宏定义 - 与 C 代码混合编译并通过测试 -#### 编译教程 +## 从源码编译 + +### 前置条件 需准备前置条件,以便 curl-rust 能正确地编译,需要的前置条件有: -make, rustup, cargo, nightly 版的 rustc, gcc, openssl-libs, automake 等。 + +- make +- rustup +- cargo +- nightly 版的 rustc +- gcc +- openssl-libs +- automake 等。 + +可以使用如下命令完成完成安装: + +``` +sudo yum install -y gcc openssl-libs automake make cmake +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rustlang.sh +sh rustlang.sh -y +rustup install nightly +rustup default nightly +``` 准备好前置条件后,可以按如下步骤完成编译: @@ -27,7 +46,7 @@ make, rustup, cargo, nightly 版的 rustc, gcc, openssl-libs, automake 等。 4. 执行`make`完成编译 5. 还可以执行`make test`进行测试 -#### 参与贡献 +## 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支