Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我试图通过我的 sockaddr_in 获取客户端的 ip,但这个 ip 总是 192.168.1.1(路由器 ip)。我怎样才能正确获得 WAN ip?
听起来您在路由器上运行了某种反向代理。它可能在某处添加了客户端 IP,例如作为 HTTP 的 X-Forwarded-For 标头。