lanproxy-nat icon indicating copy to clipboard operation
lanproxy-nat copied to clipboard

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

Open l-jessie opened this issue 1 year ago • 0 comments

客户端. 服务端 均使用 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

l-jessie avatar Jul 01 '24 02:07 l-jessie