Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

协助: 如何获取请求公网IP #7

Open
l-jessie opened this issue Jul 1, 2024 · 0 comments
Open

协助: 如何获取请求公网IP #7

l-jessie opened this issue Jul 1, 2024 · 0 comments

Comments

@l-jessie
Copy link

l-jessie commented Jul 1, 2024

客户端. 服务端 均使用 docker 部署

服务端

version: '3.8'
services:
lanproxy-server:
image: franklin5/lanproxy-server
container_name: lanproxy-server
environment:
- LANPROXY_USERNAME=admin
- LANPROXY_PASSWORD=*****
volumes:
# 用于保存创建的配置文件,避免重启服务后配置消失
- /usr/local/docker/lanproxy-server/config-data:/root/.lanproxy
ports:
- 8090:8090
- 4900:4900
- 4993:4993
- 9000-9100:9000-9100
restart: always

客户端

version: '3.8'
services:
lanproxy-client:
image: franklin5/lanproxy-client
container_name: lanproxy-client
environment:
- LANPROXY_KEY=oioioierwerec5bs33sda23
- LANPROXY_HOST=212.117.154.534 # (非正确ip)
restart: always

我访问 212.117.154.534:9000 -----> 192.168.10.25:8989
现在我的 192.168.10.25 Java web 服务里面无法获取到真实的ip地址 需要怎么弄?

IPUtils header 打印:: content-type: application/json
IPUtils header 打印:: accept: /
IPUtils header 打印:: connection: keep-alive
IPUtils header 打印:: content-length: 156
IPUtils header 打印:: user-agent: meta/1.0 (build:1; iOS 17.5.1) Alamofire/5.9.1
IPUtils header 打印:: accept-language: zh-Hans-CN;q=1.0, en-GB;q=0.9
IPUtils header 打印:: authorization: Bearer eyLC
IPUtils header 打印:: accept-encoding: br;q=1.0, gzip;q=0.9, deflate;q=0.8

IPUtils--X-Forwarded-For: null
IPUtils--Proxy-Client-IP: null
IPUtils--WL-Proxy-Client-IP: null
IPUtils--HTTP_CLIENT_IP: null
IPUtils--HTTP_X_FORWARDED_FOR: null
IPUtils--getRemoteAddr: 172.18.0.1
获取客户端IP地址: 172.18.0.1

我打印了请求头, 并没有X-Forwarded-For

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant