24个版本
新 0.4.4 | 2024年8月24日 |
---|---|
0.4.3 | 2024年8月24日 |
0.3.7 | 2024年8月23日 |
0.2.0 | 2024年8月21日 |
0.1.12 | 2024年8月21日 |
#817 in Web编程
2,162 每月下载量
93KB
2K SLoC
h10
无外部依赖的简单HTTP/1.0服务器(WIP)
入门
安装
cargo install h10
安装模式
./h10-server --ip-address=127.0.0.1 --port=9000
或
./h10-server --help
注意
使用--http1.0
参数将使浏览器发出的请求返回400(错误请求)代码。
./h10-server --http1.0 --ip-address=127.0.0.1 --port=9000
使用方法
h10 (v0.3.4): Simple HTTP/1.0 Server - https://github.com/ancos2505/h10
Usage: h10-server [OPTION]
Options:
--help Display this message
--verbose Show raw contents from both Request and Response
--http1.0 Enable strict HTTP/1.0 strict mode (RFC1945)
WARNING: The nowday's browsers doesn't use it anymore
--ip-address=<IP ADDRESS> IPv4 or IPv6 to listening
--port=<PORT NUMBER> Port to listen [1024-65535] (RFC7605#section-4)
开发模式
终端1
cargo run
终端2
curl -v localhost:8080
或在浏览器中打开:https://127.0.0.1:8080/
路线图
- 在特定文件夹中提供沙盒静态文件服务
- 上传文件
- 实现完整的RFC1945规范