windows配置PAC自动脚本(转)

admin4年前复制粘贴918


PAC文件内容示例

function FindProxyForURL(url, host) {

var proxy1 = "PROXY 192.168.1.100:8888";
var proxy2 = "PROXY 192.168.1.111:8888";

var direct = "DIRECT";

    //本地地址直接连接
if (isPlainHostName(host)) {
        return direct;
    }
// 代理1
if (shExpMatch(url, "*baidu.com*")) {
        return proxy1;
    }
// 代理2
if (shExpMatch(url, "*csdn.com*")) {
   return proxy2;
   }
   
return direct;
}


自动设置代理脚本(win10测试 没生效20220620)

@echo off
color 0a
title Use autoconfig script
echo Starting......
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v ProxyEnable /t REG_DWORD /d 0 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections" /v DefaultConnectionSettings /t REG_BINARY /d 46000000020000000900 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections" /v SavedLegacySettings /t REG_BINARY /d 46000000020000000900 /f
reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings" /v AutoConfigURL /d "http://域名/pac/proxy.pac" /f
echo End
@echo off


IE浏览器https不生效问题,运行一下注册表配置

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Policies\Microsoft\Windows\CurrentVersion\Internet Settings]
"EnableAutoproxyResultCache"=0


相关文章

js压缩图片(转,记录备用)

<!DOCTYPE html> <html> <head> <meta charset="UTF-8">...

mysql导出指定时间段binlog(需要已经开启binlog)

mysqlbinlog --no-defaults --start-datetime="2018-09-06 13:45:00" --sto...

docker常用命令(持续添加...)

#搜索镜像 php可替换为其他 docker search php #拉取php镜像 docker pull php #拉取指定版本镜...

nginx配置详解(转)

nginx配置文件结构...              #全...

linux设置swap分区(转)

1、linux设置swap查看swap位置cat /proc/swaps得到你的swap文件的位置,但不一定叫swap,或许叫/dev/sdb5。关闭并删除较小的swap文件sudo&nbs...

Ubuntu编译安装Nginx(转)

1、依赖安装sudo apt-get update sudo apt-get install build-essential sudo ...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。