From abc2387bd4790b88da436e89143aadc35ac0c4d6 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Sun, 27 Sep 2020 04:40:39 +0800 Subject: [PATCH] Update README.md to Caddy v2 with Caddyfile --- README.md | 64 ++++++++++--------------------------------------------- 1 file changed, 11 insertions(+), 53 deletions(-) diff --git a/README.md b/README.md index f154d3596b..9bd6e08c36 100644 --- a/README.md +++ b/README.md @@ -37,63 +37,21 @@ git clone -b naive https://github.com/klzgrad/forwardproxy go get -u github.com/caddyserver/xcaddy/cmd/xcaddy ~/go/bin/xcaddy build --with github.com/caddyserver/forwardproxy=$PWD/forwardproxy sudo setcap cap_net_bind_service=+ep ./caddy -./caddy run --config caddy.json ``` - -
-Example caddy.json using Let's Encrypt (replace example values accordingly) - -```json -{ - "admin": {"disabled": true}, - "logging": { - "sink": {"writer": {"output": "discard"}}, - "logs": {"default": {"writer": {"output": "discard"}}} - }, - "apps": { - "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": "use a secret name or empty string here:0"} - }] - }, { - "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" - } - }] - } - } +Then `./caddy run` with the following Caddyfile (replace the example values accordingly): +``` +:443, example.com +tls me@example.com +route { + forward_proxy { + basicauth user pass + hide_ip + hide_via + probe_resistance secret.com } + file_server { root /var/www/html } } ``` -
- Locally run `./naive` with the following `config.json` to get a SOCKS5 proxy at local port 1080. ```json