windows配置PAC自动脚本(转)

admin4年前复制粘贴617


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">...

zip和unzip基本命令(转)

一、基本参数1、zip命令的常用参数-d:从压缩文件内删除指定的文件-D:压缩文件内不建立目录名称-g:将文件压缩后附加在已有的压缩文件之后,而非另行建立新的压缩文件-m:将文件压缩并加入压缩文件后,...

花生壳和pubyun(原3322)在linux下快速解析

一、花生壳通过设置路由器自定义地址(免费版已经无法解析)http://用户名:密码@/ddns.oray.com/ph/update?&hostname=域名/ curl -fsS...

ubuntu的一些基本设置

一、设置开机启动(/etc/rc.local)将/lib/systemd/system/rc-local.service 链接到 /etc/systemd/system/# ln ...

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

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

Ubnt路由器设置ssl证书(转)

根据 Ubnt路由器更换HTTPS证书文件 的说明,更换证书,大部分情况下我们再CA机构拿到的证书一般是 xxx.pem xxx.key 两个文件(nginx)版,或者apache版 xxx.key...

发表评论    

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