From bb9b941b17e41d10afed96837e4d0b61111d99e5 Mon Sep 17 00:00:00 2001 From: shiyu Date: Wed, 17 Apr 2024 00:09:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BD=BF=E7=94=A8=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/README.md b/README.md index abcb627..c8537f9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,22 @@ # http_echo_ip 一个只会输出IP的http服务,配合DDNS使用 + +参数 +``` +-l, --listen 监听地址 [default: 127.0.0.1] +-p, --port 监听端口号 [default: 80] +``` +cli: `http_echo_ip -l 127.0.0.1 -p 23343` + +docker: `docker run --name echo_ip -d --restart always --network host evlan/http_echo_ip -l 127.0.0.1 -p 23343` + +配合nginx反代 +``` + location = /ip { + proxy_pass http://127.0.0.1:23343; + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header REMOTE-HOST $remote_addr; + } +``` \ No newline at end of file