Linux 端有没有一款支持分流、可以查看连接信息且方便修改规则的代理工具 - V2EX
SlanWyf

Linux 端有没有一款支持分流、可以查看连接信息且方便修改规则的代理工具

  •  
  •   SlanWyf Jul 7, 2024 3530 views
    This topic created in 678 days ago, the information mentioned may be changed or developed.

    想要实现的功能就是 linux 运行代理工具共享给局域网的其他终端。首先这个工具需要有 Ui 其次要能看到连接信息,比如那个域名匹配了那条规则有没有走代理,最后要能方便的修改规则。 类似于 openwrt 上的 openclash 。使用场景比如说,通过 UI 的连接信息可以看到 steam 在下载的时候有一个 SteamPipe 的域名走了代理,因为这是 steam 新的内容分发系统,之前规则没有匹配,默认走代理,那么我就在覆写规则中添加一条规则就可以了 但是 openwrt 的 docker 以及作为一台服务器来说肯定和 linux 没法比,而让 linux 以 docker 的方式运行 openwrt 也没必要,所以想问问有没有符合条件的 linux 代理工具

    Supplement 1    Jul 7, 2024
    因为 linux 用的是 server 版,所以 UI 指的是 yacd 等 dashboard
    12 replies    2024-07-09 10:04:04 +08:00
    adrianzhang
        1
    adrianzhang  
       Jul 7, 2024
    Clash 起初就是运行在 Linux ,后来才有 OpenClash 运行在 OpenWRT
    Pteromyini
        2
    Pteromyini  
       Jul 7, 2024
    clashverge
    KagurazakaNyaa
        3
    KagurazakaNyaa  
       Jul 7, 2024
    感觉 v2raya 就不错,写规则很方便
    如果只要本机代理不需要给其他设备开 socks/http 代理,或者只作为透明代理网关使用,可以试试 dae/daed
    https://github.com/v2rayA/v2rayA
    https://github.com/daeuniverse/dae
    https://github.com/daeuniverse/daed
    ptg2008
        4
    ptg2008  
       Jul 7, 2024
    有的 我用 manjaro, pamac install --aur mihomo, 配置规则如下:
    ptg2008
        5
    ptg2008  
       Jul 7, 2024
    pr: &pr {type: select, proxies: [默认,香港,台湾,日本,新加坡,美国,其它地区,全部节点,自动选择,直连]}
    p: &p {type: http, interval: 3600, health-check: {enable: true, url: https://www.gstatic.com/generate_204, interval: 300}}#

    # url 里填写订阅,名称不能重复
    proxy-providers:
    xxxx:
    <<: *p
    path: ./xxxx.yaml
    url: ""



    ipv6: false
    allow-lan: true
    mixed-port 7890
    unified-delay: false
    tcp-concurrent: true
    external-controller: :9999
    external-ui: /etc/mihomo/ui
    external-ui-name: xd
    # 因为 linux 用的是 server 版,所以 UI 指的是 yacd 等 dashboard
    external-ui-url: "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip"

    geodata-mode: true
    geodata-loader: standard
    geo-auto-update: true
    geo-update-interval: 24
    geox-url:
    geoip: "https://mirror.ghproxy.com/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip-lite.dat"
    geosite: "https://mirror.ghproxy.com/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat"
    mmdb: "https://mirror.ghproxy.com/https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/country-lite.mmdb"

    find-process-mode: strict
    global-client-fingerprint: chrome

    sniffer:
    enable: true
    sniff:
    HTTP:
    ports: [80, 8080-8880]
    override-destination: true
    TLS:
    ports: [443, 8443]
    QUIC:
    ports: [443, 8443]
    skip-domain:
    - '*.rc.sunlogin.net'

    tun:
    enable: true
    stack: system
    dns-hijack: ["any:53"]
    auto-route: true
    auto-detect-interface: true

    dns:
    enable: true
    listen: :53
    ipv6: false
    enhanced-mode: redir-host
    nameserver: ["tls://8.8.4.4", "tls://208.67.222.222"]
    nameserver-policy:
    "geosite:cn": ["202.96.128.166", "223.5.5.5"]

    hosts:
    '*.ptg.com': 192.168.66.55

    proxies:
    - name: "直连"
    type: direct
    udp: true
    proxy-groups:
    - {name: 默认, type: select, proxies: [自动选择, 直连, 香港, 台湾, 日本, 新加坡, 美国, 其它地区, 全部节点]}
    - {name: YouTube, <<: *pr}
    - {name: Google, <<: *pr}
    - {name: OpenAI, <<: *pr}
    - {name: 国内, type: select, proxies: [直连, 默认, 香港, 台湾, 日本, 新加坡, 美国, 其它地区, 全部节点, 自动选择]}
    - {name: 其他, <<: *pr}
    # 地区分组
    - {name: 香港, type: select , include-all-providers: true, filter: "(?i)港|hk|hongkong|hong kong"}
    - {name: 台湾, type: select , include-all-providers: true, filter: "(?i)台|tw|taiwan"}
    - {name: 日本, type: select , include-all-providers: true, filter: "(?i)日|jp|japan"}
    - {name: 美国, type: select , include-all-providers: true, filter: "(?i)美|us|unitedstates|united states"}
    - {name: 新加坡, type: select , include-all-providers: true, filter: "(?i)(新|sg|singapore)"}
    - {name: 其它地区, type: select , include-all-providers: true, filter: "(?i)^(?!.*(?:|||||港|hk|hongkong|台|tw|taiwan|日|jp|japan|新|sg|singapore|美|us|unitedstates)).*"}
    - {name: 全部节点, type: select , include-all-providers: true}
    - {name: 自动选择, type: url-test, include-all-providers: true, tolerance: 10}

    rules:
    - GEOIP,lan,直连,no-resolve
    - GEOIP,private,直连,no-resolve
    - GEOSITE,youtube,YouTube
    - GEOSITE,google,Google
    - GEOSITE,openai,OpenAI
    - GEOSITE,cn,国内
    - GEOSITE,geolocation-!cn,其他
    - GEOIP,CN,国内
    - MATCH,其他
    ptg2008
        6
    ptg2008  
       Jul 7, 2024
    不好意思 v2 的回复不太会用, 按 cmd+enter 以为换行, 直接发出去了, 我用 linux 发行版是 manjaro
    1. pamac install --aur mihomo
    2. sudo vim /etc/mihomo/config.yaml(在这里自己定义配置, 想必贴主应该熟悉这个配置文件, #5 是我的配置, 供参考)
    3. sudo echo 1 > /proc/sys/net/ipv4/ip_forward(开启内核 ip v4 转发功能)
    4. sudo systemctl enable --now mihomo.service
    GrayXu
        7
    GrayXu  
       Jul 7, 2024
    openclash 不就是 clash 的 client ,装个 clash 用 yacd 呗
    zhanghua0
        8
    zhanghua0  
       Jul 8, 2024
    sing-box 有 clash api 支持,能用在 yacd 上,不过得自己写配置,核心本身不支持订阅
    happyxhw101
        9
    happyxhw101  
       Jul 8, 2024
    SlanWyf
        10
    SlanWyf  
    OP
       Jul 8, 2024
    @adrianzhang
    @GrayXu openclash 符合我条件是因为可以直接在 wrt 的页面补充规则覆盖配置文件中的规则,非常方便,不用编辑配置,clash 没用过不清楚可不可以做到类似的效果。
    adrianzhang
        11
    adrianzhang  
       Jul 8, 2024
    @SlanWyf 如果能够提取出来 open clash 的页面 folder ,放到 clash 中能够实现同样效果。clash 和 openclash API 通用,只不过 openclash 定制了面板。
    GrayXu
        12
    GrayXu  
       Jul 9, 2024
    @SlanWyf #10 没有那么多场景需要频繁改动 rules 的,vim is all u need
    About     Help     Advertise     Blog     API     FAQ     Solana     870 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 43ms UTC 20:32 PVG 04:32 LAX 13:32 JFK 16:32
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86