如果确定请求是来自本地网络的未来(内网) [英] Identify if request is coming from local network (intranet)

查看:167
本文介绍了如果确定请求是来自本地网络的未来(内网)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要确定一个请求使用任何客户端或服务器端来自Internet或Intranet。

I need to identify if a request comes from Internet or Intranet using either client-side or server-side.

我试图解决的问题是:我们的网站可以从Internet和Intranet访问。内网用户(公司内部),不能访问互联网。我们使用的是谷歌Anylitics,当内网用户访问该页面时,页面很长时间才能上传,因为它尝试下载(GA)JavaScript文件从谷歌产生的。

The problem I'm trying to solve is: our web site can be accessed from internet and intranet. The intranet user (user inside company), does not have access to internet. We are using Google Anylitics, when intranet user access the page, the page take so long to upload because it tries to download (ga) JavaScript file generated from Google.

任何解决方案?

推荐答案

您可以检查用户的IP地址。私人IP4地址总是要么10的,或172。的,或192 * ...在专用网络上的详细信息的这里

You can check the ip address of a user. Private ip4 address always start with either 10., or 172., or 192.* ... more info on private networks here.

您也可以使谷歌Analytics(分析)异步加载

这篇关于如果确定请求是来自本地网络的未来(内网)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆