浏览器代理插件@按规则自动切换代理模式@ZeroOmega配置协议分流@http链接直连

文章目录

abstract

本文介绍为现代浏览器(以edge)为例,配置浏览器对不同url配置不同代理,尤其是根据协议选择是否走代理

http://https://为例,假设我希望前者不走代理(或者总是直连),而后者走代理(或者更加精细的代理规则)

插件选择

功能类似的插件较多,这里选择相对功能比较完善的,对chromium和系和火狐系浏览器都支持良好的ZeroOmega

GitHub - zero-peak/ZeroOmega: Manage and switch between multiple proxies quickly & easily.

配置案例

将配置保存为.json文件(或.txt等任何文本文件)

然后在插件设置中导入此文本文件

供参考的在线版本(包含三组规则,不过每组规则都差不多,只是端口不一样而已):(可能会失效)

http 复制代码
https://gitee.com/xuchaoxin1375/scripts/raw/main/Config/ZeroOmegaOptions.json

下面是使用本地透明代理http://localhost:10808 创建的代理规则

为了实现根据url链接分流,需要创建一个自动切换[auto-switch]的情景模式(profile),在两种模式在自动切换:

  • 如果url是http://链接,则走[Direct]模式(直连不走代理),注意,[直接连接]模式是默认存在的模式,不需要手动创建,在自动切换模式中编写切换规则时,可以直接引用直接连接模式
  • 如果url是https://链接,则走代理,这里需要通过选择已经创建好的普通情景模式

第一个重要步骤是创建一个普通代理情景模式(proxy profile,代理服务器)

例如下面的简单情景模式(几乎是默认的,不过普通情景模式允许你通过域名通配符绕过一些不需要走代理的网站,例如访问特征明显的国内网站(.cn)网站,具体比如bt.cn),这种即便是https链接也不推荐走代理

第二个重要步骤,在自动情景模式中配置模式切换规则

导出的备份参考(json)

json 复制代码
{
    "+auto-direct-10808": {
        "color": "#ca0",
        "defaultProfileName": "direct",
        "name": "auto-direct-10808",
        "profileType": "SwitchProfile",
        "revision": "19aa60318dc",
        "rules": [
            {
                "condition": {
                    "conditionType": "UrlWildcardCondition",
                    "pattern": "http://*"
                },
                "profileName": "direct"
            },
            {
                "condition": {
                    "conditionType": "UrlWildcardCondition",
                    "pattern": "https://*"
                },
                "profileName": "https10808"
            }
        ]
    },
    "+https10808": {
        "bypassList": [
            {
                "conditionType": "BypassCondition",
                "pattern": "127.0.0.1"
            },
            {
                "conditionType": "BypassCondition",
                "pattern": "[::1]"
            },
            {
                "conditionType": "BypassCondition",
                "pattern": "localhost"
            },
            {
                "conditionType": "BypassCondition",
                "pattern": "*.cn"
            },
            {
                "conditionType": "BypassCondition",
                "pattern": "*.test"
            }
        ],
        "color": "#9ce",
        "fallbackProxy": {
            "host": "localhost",
            "port": 10808,
            "scheme": "http"
        },
        "name": "https10808",
        "profileType": "FixedProfile",
        "revision": "19aa9545f9f"
    },
    "-addConditionsToBottom": false,
    "-confirmDeletion": true,
    "-downloadInterval": 1440,
    "-enableQuickSwitch": false,
    "-monitorWebRequests": true,
    "-quickSwitchProfiles": [],
    "-refreshOnProfileChange": true,
    "-revertProxyChanges": true,
    "-showConditionTypes": 1,
    "-showExternalProfile": true,
    "-showInspectMenu": true,
    "-showResultProfileOnActionBadgeText": false,
    "-startupProfileName": "",
    "schemaVersion": 2
}
相关推荐
panzer_maus3 天前
工厂模式、代理模式与单例模式的介绍
java·设计模式·代理模式
花月C3 天前
线性动态规划(Linear DP)
算法·动态规划·代理模式
散峰而望4 天前
【基础算法】动态规划从入门到进阶:记忆化搜索、线性 DP、LIS/LCS 一网打尽
c++·后端·算法·github·深度优先·动态规划·代理模式
淡忘旧梦4 天前
ChatGPT回答白屏
人工智能·chatgpt·代理模式
REDcker4 天前
WebXR 技术详解:标准、生态与开发入门
浏览器·web
牛奶4 天前
5MB vs 4KB vs 无限大:浏览器存储谁更强?
前端·浏览器·indexeddb
会编程的土豆4 天前
【数据结构与算法】动态规划
数据结构·c++·算法·leetcode·代理模式
范纹杉想快点毕业6 天前
C语言编程实战宝典:550例精解·涵盖基础语法·数组指针·位运算·递归·贪心·动态规划
c语言·动态规划·代理模式
想不明白的过度思考者6 天前
SpringAOP:Java 三大代理模式:从静态代理到 JDK & CGLIB 动态代理
java·开发语言·代理模式
x-cmd7 天前
[x-cmd] 专为 AI Agent 设计的无头浏览器,比 Chrome 速度快 9 倍且少用 16 倍内存 | Lightpanda
前端·chrome·ai·自动化·agent·浏览器·x-cmd