Update README.md

This commit is contained in:
klzgrad 2020-06-16 20:19:15 +08:00 committed by GitHub
parent 6f4bc52250
commit 38fc123c16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,56 +19,86 @@ NaïveProxy uses Chrome's network stack. The traffic behavior intercepted by the
Frontend also reroutes unauthenticated users and active probes to a backend HTTP server, making it impossible to detect the existence of a proxy, like this: Probe ⟶ Frontend ⟶ index.html Frontend also reroutes unauthenticated users and active probes to a backend HTTP server, making it impossible to detect the existence of a proxy, like this: Probe ⟶ Frontend ⟶ index.html
Starting from v84, users can run a naïve fork of Caddy forwardproxy without the Naïve server.
## Download ## Download
See [latest release](https://github.com/klzgrad/naiveproxy/releases/latest). See [latest release](https://github.com/klzgrad/naiveproxy/releases/latest). Linux, Windows, Mac OS, and various OpenWrt targets are supported.
Users should always use the latest version to keep signatures identical to Chrome.
Note: On Linux libnss3 must be installed before using the prebuilt binary. Note: On Linux libnss3 must be installed before using the prebuilt binary.
## Setup ## Setup
On the server, download Caddy (from https://caddyserver.com/download with plugin: http.forwardproxy): On the server, build and run Caddy v2 with naïve fork of forwardproxy:
``` ```sh
curl -OJ 'https://caddyserver.com/download/linux/amd64?plugins=http.forwardproxy&license=personal' git clone -b naive https://github.com/klzgrad/forwardproxy
tar xf ./caddy_*.tar.gz go get -u github.com/caddyserver/xcaddy/cmd/xcaddy
sudo setcap cap_net_bind_service=+ep caddy ~/go/bin/xcaddy build --with github.com/caddyserver/forwardproxy=./forwardproxy
sudo setcap cap_net_bind_service=+ep ./caddy
./caddy run --config caddy.json
``` ```
Run `./caddy` with the following Caddyfile (replace the example values accordingly): `caddy.json` using Let's Encrypt (replace the example values accordingly):
``` <details>
domain.example <summary>Example caddy.json using Let's Encrypt (replace example values accordingly)</summary>
root /var/www/html
tls myemail@example.com
forwardproxy {
basicauth user pass
hide_ip
hide_via
probe_resistance secret.localhost
upstream http://127.0.0.1:8080
}
```
and `./naive` with the following `config.json`:
```json ```json
{ {
"listen": "http://127.0.0.1:8080", "apps": {
"padding": true "http": {
"servers": {
"srv0": {
"listen": [":443"],
"routes": [{
"handle": [{
"handler": "forward_proxy",
"hide_ip": true,
"hide_via": true,
"auth_user": "username",
"auth_pass": "password",
"probe_resistance": {"domain": "secret.localhost"}
}]
}, {
"match": [{"host": ["example.com", "www.example.com"]}],
"handle": [{
"handler": "file_server",
"root": "/var/www/html"
}],
"terminal": true
}],
"tls_connection_policies": [{
"match": {"sni": ["example.com", "www.example.com"]}
}]
}
}
},
"tls": {
"automation": {
"policies": [{
"subjects": ["example.com", "www.example.com"],
"issuer": {
"email": "admin@example.com",
"module": "acme"
}
}]
}
}
}
} }
``` ```
</details>
Locally run `./naive` with `config.json`:
Locally run `./naive` with the following `config.json` to get a SOCKS5 proxy at local port 1080.
```json ```json
{ {
"listen": "socks://127.0.0.1:1080", "listen": "socks://127.0.0.1:1080",
"proxy": "https://user:pass@domain.example", "proxy": "https://username:password@example.com"
"padding": true
} }
``` ```
to get a SOCKS5 proxy at local port 1080.
See [USAGE.txt](https://github.com/klzgrad/naiveproxy/blob/master/USAGE.txt) on how to configure `config.json`. See also [Parameter Tuning](https://github.com/klzgrad/naiveproxy/wiki/Parameter-Tuning) to improve client-side performance. See [USAGE.txt](https://github.com/klzgrad/naiveproxy/blob/master/USAGE.txt) for more parameters in `config.json`. See also [Parameter Tuning](https://github.com/klzgrad/naiveproxy/wiki/Parameter-Tuning) to improve client-side performance.
It's possible to run Caddy without Naive server, but you need to remove `padding` from `config.json` and `upstream` from Caddyfile.
## Build ## Build