代理PAC文件中的myIpAddress()函数返回错误的IP地址 [英] myIpAddress() Function in Proxy PAC File Returns Wrong IP Address

查看:274
本文介绍了代理PAC文件中的myIpAddress()函数返回错误的IP地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Internet Explorer版本:8.0.7600.16385

操作系统:Windows 7 Enterprise

操作系统版本:6.1.7600 N / A Build 7600


我使用代理自动配置(PAC)文件来动态确定我的浏览器流量何时需要通过代理进行路由。 PAC脚本检查主机IP地址的前三个八位字节以确定机器的位置,然后使用
代理。使用代理取决于位置。脚本如下:


 函数 FindProxyForURL(url,host)
{
alert('主机名:' + host)
alert ('isPlainHostName():' + isPlainHostName(host))

if (shExpMatch(myIpAddress()," 99.100.70。*" )|| shExpMatch(myIpAddress()," 98.100.75。*" )|| shExpMatch(myIpAddress()," 100.99.70。*" )) {

//使用本地域中的-with绕过代理
if (shExpMatch(host," * .ghrsystems.com" )){ return " DIRECT" ; }

//访问本地网站时绕过代理
if (isPlainHostName(host)){ return " DIRECT" ; }

return " PROXY 10.132.230.33:8080" ;
}

//假设我的笔记本电脑不工作。
return "DIRECT";
}

解决方案

嗨亚当,


 


我认为你的问题应该在  Internet Explorer Web开发
我相信他们会比我们了解更多关于这个问题的信息,我会把这个问题移到那个论坛。


 


感谢您的理解,


 


最好的问候,


Jesse


Internet Explorer Version: 8.0.7600.16385
OS: Windows 7 Enterprise
OS Version: 6.1.7600 N/A Build 7600

I employed a proxy automatic configuration (PAC) file to dynamically determine when my browser traffic needs to route thru a proxy. The PAC script examines the first three octets of the host machine's IP address to determine the machine's location then use a proxy. Use of a proxy depends on location. The script is as follows:

function FindProxyForURL(url, host)
{
	alert('Host name: ' + host)
	alert('isPlainHostName(): ' + isPlainHostName(host))

	if (shExpMatch(myIpAddress(), "99.100.70.*") || shExpMatch(myIpAddress(), "98.100.75.*") || shExpMatch(myIpAddress(), "100.99.70.*")) {

		//Bypass the proxy for URLs with-in the local domain
		if (shExpMatch(host, "*.ghrsystems.com")) { return "DIRECT"; }
		
		//Bypass the proxy when accessing local sites
		if (isPlainHostName(host)) { return "DIRECT"; }
		
		return "PROXY 10.132.230.33:8080";
	}
	
	//Assume my laptop is not at work.
	return "DIRECT";
}

解决方案

Hi Adam,

 

I think your issue should be raised in the Internet Explorer Web Development. I believe they will know more information of this issue than us, and I will move this one to that forum.

 

Thanks for your understanding,

 

Best regards,

Jesse


这篇关于代理PAC文件中的myIpAddress()函数返回错误的IP地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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