[英]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.