feat: v0.2.0-rc, optimize code

This commit is contained in:
2024-03-30 20:32:27 +08:00
parent 03b4fee86a
commit f75ead77f3

View File

@@ -2,9 +2,10 @@
## Introduction ## Introduction
`proxy-inspector` is a HTTP/HTTPS proxy based on `pingora`, `proxy-inspector` can issue certificate just in time, `proxy-inspector` can dump HTTP/HTTPS request and response. `proxy-inspector` is a HTTP/HTTPS proxy based on `pingora`, `proxy-inspector` can issue certificate just in
time, `proxy-inspector` can dump HTTP/HTTPS request and response.
## Configure ## Configuration
`proxy_config.json` sample config: `proxy_config.json` sample config:
@@ -57,11 +58,9 @@ $ cargo r --example generate_self_signed_ca
When generate success, cert and key will write to files `cert.pem`, `cert.key`, fail if any file is existed. When generate success, cert and key will write to files `cert.pem`, `cert.key`, fail if any file is existed.
## Example ## Run Example
Proxy example: Edit `/etc/hosts` add line:
Edit `/etc/hosts` add:
```text ```text
127.0.0.1 www.baidu.com 127.0.0.1 www.baidu.com
@@ -119,7 +118,7 @@ $ curl https://www.baidu.com/not-found -v
</body></html> </body></html>
``` ```
Log from proxy-inspector: Log from `proxy-inspector` console:
```text ```text
[2024-03-30T12:21:28Z INFO proxy_inspector::service] SNI provided: www.baidu.com [2024-03-30T12:21:28Z INFO proxy_inspector::service] SNI provided: www.baidu.com
@@ -152,7 +151,7 @@ Log from proxy-inspector:
]]] ]]]
``` ```
proxy-inspector did the follow steps: `proxy-inspector` do the follow steps:
1. issue certificate for `www.baidu.com` 1. issue certificate for `www.baidu.com`
2. receive request `GET /not-found`, print request to log 2. receive request `GET /not-found`, print request to log