美文网首页
(Proxy) macOS系统自动配置代理

(Proxy) macOS系统自动配置代理

作者: 布呐呐u | 来源:发表于2022-12-28 18:00 被阅读0次

1)进入如下目录

cd /Library/WebServer/Documents

2)新建如下文件

touch proxy.pac

3)添加如下方法

function FindProxyForURL(url, host) { 
 if (shExpMatch(url,"*www.jianshu.com/*") || shExpMatch(url,"*mail.neusoft.com/*")) {
     return "PROXY dl-proxy.neusoft.com:8080;";
 } else {
     return "PROXY 10.1.128.235:3128;";
 }
}

4)自动配置代理URL

http://localhost/proxy.pac

5)启动服务

sudo apachectl start

相关文章

网友评论

      本文标题:(Proxy) macOS系统自动配置代理

      本文链接:https://www.haomeiwen.com/subject/tmjzqdtx.html