2 个版本
0.1.1 | 2021 年 4 月 21 日 |
---|---|
0.1.0 | 2021 年 4 月 21 日 |
#289 in #proxy
10KB
125 行
server-security-proxy
用 Rust 编写的服务器安全代理
如何使用
-
- 配置 toml 文件
[proxy]
server_addr = "0.0.0.0:8081"
to_addr = "127.0.0.1:8080"
[log]
# see how to configrution simple-log:https://github.com/baoyachi/simple-log
path = "./var/log/server_security/server_security.log"
level = "INFO"
size = 200
out_kind = ["file"]
roll_count = 300
- 运行 exec:./server_security ./config/server_config.toml
use server_security::start;
use std::process::exit;
#[tokio::main]
async fn main() {
let args: Vec<String> = std::env::args().map(|x| format!("{}", x)).collect();
if args.len() < 2 {
println!("lost config path error");
exit(-1);
}
start(format!("{}", args[1])).await.unwrap();
}
待办事项
- 安全验证
- 通知
- 监控
依赖项
~15–24MB
~405K SLoC