简体   繁体   English

如果我使用客户端javascript获取网站,该网站将看到什么作为请求IP?我的服务器或客户端?

[英]If i GET a site using client-side javascript, what will the site see as the requesting ip? My server or the client's?

I'm building an app where the user may occasionally make a search. 我正在构建一个用户可能偶尔进行搜索的应用程序。 I'd like to run the search through google, but I'm unsure in the event I have many users if i will hit google's search quota. 我想通过谷歌搜索,但我不确定如果我有很多用户,如果我将达到谷歌的搜索配额。 Any individual user will not make more than one or two searches a day on the app. 任何个人用户每天都不会在应用上进行超过一两次搜索。 But cumulatively, it could potentially be much more. 但累积起来,它可能会更多。

Will doing client side retrival of a google query avoid this problem and not identify my server as the origin ip? 将客户端的谷歌查询回复避免这个问题,而不是将我的服务器识别为原始IP?

是的,如果您从客户端执行GET请求,则客户端IP将是源IP

Since you are doing a GET from the client's side, the TCP/IP connection is being opened by the client. 由于您从客户端进行GET,因此客户端正在打开TCP / IP连接。 So it would be the client's IP that the site would see as the requesting IP. 因此,该网站将视为请求IP的客户端IP。 However if you would like the site to see your IP instead, you can re-route the request via AJAX to your server, have your server do the GET and send the results asynchronously back to the client. 但是,如果您希望站点看到您的IP,您可以通过AJAX将请求重新路由到您的服务器,让您的服务器执行GET并将结果异步发送回客户端。

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

相关问题 javascript-我的客户端选项是什么? - javascript - What are my client-side options? 从客户端JavaScript生成的站点生成静态HTML - Generate Static HTML From Client-Side JavaScript Generated Site 单页站点的客户端模板 - Client-side templating for a Single page site 如何将服务器端ASP XmlHttpRequest代码转换为客户端JavaScript? - How do I convert my server-side ASP XmlHttpRequest code to client-side JavaScript? 服务器端和客户端JavaScript - Server-side and client-side JavaScript 我可以使用客户端 Javascript 执行 DNS 查找(主机名到 IP 地址)吗? - Can I perform a DNS lookup (hostname to IP address) using client-side Javascript? 获取请求我的其余api而不是客户端的服务器的ip - Get the ip of server requesting my rest api not client 使用Javascript在客户端上从服务器打开文本文件 - Open a text file from server on the Client-side using Javascript 跨站点json rpc:使用Javascript客户端的Python服务器端和Mozilla扩展 - Cross-site json rpc : Python server side and Mozilla extension using Javascript client side 在客户端 javascript 或 websocket 服务器上转义? - Escape in client-side javascript or on websocket server?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM