简体   繁体   English

服务人员如何获取请求的远程IP地址?

[英]How can service worker get the remote ip address of a request?

How can service worker get the remote ip address of a request? 服务人员如何获取请求的远程IP地址?

devtools屏幕截图

Check this answer. 检查答案。

You have many services you can call and get your IP as response. 您可以拨打许多服务,并获取IP作为响应。

One example: 一个例子:

$.get("http://ipinfo.io", function(response) {
    console.log(response.ip);
}, "jsonp");

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM