V2rayNG浏览器代理插件 Proxy Switcher适合不同环境使用免费开源 通过配置文件支持在多种代理类型(SOCKS、PAC 和 Direct)之间进行管理和切换
bilibili视频:https://www.bilibili.com/video/BV1PG4y1d7C6
YouTube视频:https://youtu.be/HOGoDnEp5Dg
GitHub:https://github.com/wandduse/proxy-pac
博客地址:https://www.wanuse.com/2022/11/proxy-switcher-sockspac-direct.html
手机V2RAY设置http代理
下面是我自己写PAC源码在第一行"google.com"后面加上你想要的代理地址,以逗号隔开(,)。
这一行是代理服务器地址,(return "PROXY 192.168.1.23:10801";)这里可以修改成你自己的代理
服务器地址,默认使用的协议是HTTP。
(return "HTTPS 192.168.1.23:10801";)
(return "SOCKS 192.168.1.23:10801";)
(return "SOCKS4 192.168.1.23:10801";)
(return " SOCKS5 192.168.1.23:10801";)
下面有部分主要代码,完整代码需要下载。
代码:
var rules = ["ipinfo.io","google.com"]
function FindProxyForURL(url, host) {
var n = rules.length;
var ret ="";
for (var i = 0; i < n; i++)
{
if (host == rules[i] || host.endsWith('.' + rules[i]))
//if(dnsDomainIs(host,rules[i]))
{
var ret = rules[i];
break;
}
}
//if (dnsDomainIs(host, ret ))
if (host == ret || host.endsWith('.' + ret))
{
return "PROXY 192.168.1.23:10801";
}
else
{
return "DIRECT";
}
}
------------------------------------------------------------------------------------------------------------
代码下载地址
https://cowtransfer.com/s/b4b996f554234d 点击链接查看 [ ip.pac ] ,
----------------------------------------------------------------------------------------------------
用到的资料
https://developer.mozilla.org/zh-CN/doc ... D%E6%B3%95
代码:
var rules = ["ipinfo.io","google.com"]
function FindProxyForURL(url, host) {
var n = rules.length;
var ret ="";
for (var i = 0; i < n; i++)
{
if (host == rules[i] || host.endsWith('.' + rules[i]))
//if(dnsDomainIs(host,rules[i]))
{
var ret = rules[i];
break;
}
}
//if (dnsDomainIs(host, ret ))
if (host == ret || host.endsWith('.' + ret))
{
return "PROXY 192.168.1.23:10801";
}
else
{
return "DIRECT";
}
}