javascript - pac 文件 SyntaxError: Unexpected number 问题
问题描述
如果目标主机名是本地的,我正在尝试制作一个 PAC 文件来引导用户绕过代理,如果目标主机名是公共的,它将为 2 个代理分配流量。如果 2 个代理出现故障,它将直接绕过代理。它给了我 SyntaxError: Unexpected number 但我找不到任何语法错误。
function FindProxyForURL(url, host) {
//if local domains match return direct
if (isInNet(host, "172.16.0.0", "255.240.0.0") || isInNet(host, "192.168.0.0", "255.255.255.0" ) || isInNet(host, "10.0.0.0", "255.0.0.0") )
{
return "DIRECT";
}else {
// Find the 4th octet
var myip=myIpAddress()
var ipbits=myip.split(".")
var myseg=parseInt(ipbits[3])
// Check to see if the 4th octect is even or odd
if (myseg==Math.floor(myseg/2)2) {
// Even
proxy = "PROXY p1.company.com:8080; PROXY p2.company.com:8080 DIRECT";
}
else {
// Odd
proxy = "PROXY p2.company.com:8080; PROXY p1.company.com:8080 DIRECT";
}
}
}
解决方案
推荐阅读
- flutter - 颤振剪贴板选项未显示在 TextInputField 中
- sql - SQL中的时间戳差异
- php - 尝试发送电子邮件时调用字符串上的成员函数 getRealPath()
- python - 如何使用 pytesseract 对黄色立方体内的数字进行 detech
- powershell - Copy-items powershell 中的模式是什么,长度值始终为 0?
- task - AWS Connect API - StartTaskContact 操作:InvalidRequestException:
- android - 在 Xamarin Forms 中获取设备音量
- regex - google_logging_project_sink Terraform 脚本中的正则表达式过滤器错误
- coq - VecUtil:通过两种略有不同的方式获取处理后向量的第 n 个元素
- javascript - NodeJs:如何使用全局过滤器在 asyc 函数中捕获未处理的异常?