Update README

Signed-off-by: Jianhui Zhao <jianhuizhao329@gmail.com>
main
Jianhui Zhao 2017-12-30 12:41:43 +08:00
parent eede72a4d2
commit 70b761c08d
2 changed files with 37 additions and 14 deletions

View File

@ -14,6 +14,7 @@ A very tiny and fast HTTP server library based on [libubox] and referenced from
`Keep Watching for More Actions on This Space`
# Features
* action: processes requests by invoking registered C functions which mapped to a specific path.
* tiny and fast
* use [libubox] as its event backend
* support HTTPS: OpenSSL, mbedtls and CyaSSl(wolfssl)
@ -27,21 +28,31 @@ A very tiny and fast HTTP server library based on [libubox] and referenced from
* [CyaSSl(wolfssl)]: If you choose wolfssl as your SSL backend
* [openssl]: If you choose openssl as your SSL backend
## Configure
# Configure
See which configuration are supported
~/libuhttpd/$ mkdir build && cd build
~/libuhttpd/build$ cmake .. -L
~/libuhttpd/build$ cmake .. -LH
# Build
~/libuhttpd/build$ make && sudo make install
## Run the Example
# Build Example
~/libuhttpd/build$ cd ../example
~/libuhttpd/example$ mkdir build && cd build
~/libuhttpd/example/build$ cmake .. && make
# Run Example
First generate the SSL certificate file
~/libuhttpd/build$ cd ..
~/libuhttpd$ ./gen_cert.sh
~/libuhttpd/example/build$ cd ..
~/libuhttpd/example$ ./gen_cert.sh
Run
~/libuhttpd$ ./build/example/helloworld
~/libuhttpd/example$ ./build/helloworld
Then use the command curl or browser to test

View File

@ -14,9 +14,10 @@
`请保持关注以获取最新的项目动态`
# 特性
* action: 通过调用映射到特定路径的已注册C函数来处理请求。
* 小巧且快速
* 使用[libubox]作为其事件后端
* 支持HTTPS: OpenSSL, mbedtls and CyaSSl(wolfssl)
* 支持HTTPS: OpenSSL, mbedtls CyaSSl(wolfssl)
* 可伸缩你可以非常方便的扩展你的应用程序使之具备HTTP/HTTPS服务
* 代码结构简洁通俗易懂,亦适合学习
@ -27,27 +28,38 @@
* [CyaSSl(wolfssl)](https://github.com/wolfSSL/wolfssl): 如果你选择wolfssl作为你的SSL后端
* [openssl](https://github.com/openssl/openssl): 如果你选择openssl作为你的SSL后端
## 配置
# 配置
查看支持哪些配置选项
~/libuhttpd/$ mkdir build && cd build
~/libuhttpd/build$ cmake .. -L
~/libuhttpd/build$ cmake .. -LH
## 运行例子
# 编译
~/libuhttpd/build$ make && sudo make install
# 编译示例程序
~/libuhttpd/build$ cd ../example
~/libuhttpd/example$ mkdir build && cd build
~/libuhttpd/example/build$ cmake .. && make
# 运行示例程序
首先生成SSL证书文件
~/libuhttpd/build$ cd ..
~/libuhttpd$ ./gen_cert.sh
~/libuhttpd/example/build$ cd ..
~/libuhttpd/example$ ./gen_cert.sh
运行
~/libuhttpd$ ./build/example/helloworld
~/libuhttpd/example$ ./build/helloworld
然后使用命令curl或者浏览器进行测试
$ curl -k 'https://127.0.0.1:8000/hello?name=test' -d '{"name":"libuhttpd"}' -v
# 示例程序]
# 示例程序
```
#include <uhttpd.h>