网站发帖子都是http request。 所有的http request(都有一个header)从你的电脑或手机(也就是client)传到文学城server的途中可以被劫持。这是获取IP的一个渠道。
很简单的事情。
Yes, the user's IP address is often captured in an HTTP request, typically found in the X-Forwarded-For (XFF) HTTP header if the request goes through a proxy or load balancer, or directly from the TCP/IP packet's source IP address if no proxy is involved. However, the accuracy of the IP address can be affected by factors like VPNs, Tor, or spoofing, and servers generally only see the IP of the device making the request, which could be a router's external IP if the user is behind a NAT. How HTTP Captures the IP Address Direct Connection: If there is no proxy or load balancer, the web server sees the client's IP address directly from the TCP/IP packet. Through Proxies/Load Balancers: When a request passes through a proxy or load balancer, the proxy adds the client's IP address to the X-Forwarded-For header in the HTTP request. This de facto standard header preserves the original IP address of the client. Standardized Header: A newer, though less common, standardized header is the HTTP Forwarded header, which serves a similar purpose to XFF.