MetaCubeX / mihomo

A simple Python Pydantic model for Honkai: Star Rail parsed data from the Mihomo API.
https://wiki.metacubex.one
MIT License
15.71k stars 2.57k forks source link

请问,proxy-provider 里订阅链接的格式,是什么样的? #422

Open ifreeswan opened 1 year ago

ifreeswan commented 1 year ago

自建的订阅,这个订阅在 proxy-provider 里,格式不正确 请问,格式标准是什么样的?谢谢

xishang0128 commented 1 year ago

@ifreeswan 和config是一样的,只需要proxies段

ifreeswan commented 1 year ago

订阅是base64编码的,vmess:// vless:// 这种也不行, 难道是 clash 里的格式吗? - {name: tiktok运营-1, server: ... } 这种不支持

ifreeswan commented 1 year ago

vmess json 格式支持 直接用class里的格式算了。

Larvan2 commented 1 year ago
proxies:
  - name: tuic
    server: www.example.com
    port: 10443
    type: tuic
    token: TOKEN
    # ip: 127.0.0.1 # for overwriting the DNS lookup result of the server address set in option 'server'
    # heartbeat-interval: 10000
    # alpn: [h3]
    # disable-sni: true
    reduce-rtt: true
    # request-timeout: 8000
    udp-relay-mode: native # Available: "native", "quic". Default: "native"
    # congestion-controller: bbr # Available: "cubic", "new_reno", "bbr". Default: "cubic"
    # max-udp-relay-packet-size: 1500
    # fast-open: true
    # skip-cert-verify: true
    # max-open-streams: 20 # default 100, too many open streams may hurt performance

  - name: "vless-tcp"
    type: vless
    server: server
    port: 443
    uuid: uuid
    network: tcp
    servername: example.com # AKA SNI
    # flow: xtls-rprx-direct # xtls-rprx-origin  # enable XTLS
    # skip-cert-verify: true
    # fingerprint: xxxx
H1JK commented 1 year ago

We support clash format and common subscription format.

For clash format, see above.

For common format, it can be encoded in Base64, Base64URL or just in plaintext. Each share link is separated by a newline character. Invalid share links will be ignored with no error output. We support v2rayN style and Xray standard style share link for VMess/VLESS, and standards for other protocols.

It can meet nearly all your needs, I think.

kz0612 commented 1 year ago

看文档说是支持解析V2rayN等工具使用的普通订阅,但是试了发现不行

xxnuo commented 1 year ago

看文档说是支持解析V2rayN等工具使用的普通订阅,但是试了发现不行

实测是可以使用的,使用的 alpha 分支

配置:

proxy-providers:
  provider1:
    type: http
    url: "https://url/api/provider1?token=123" # 下载下来的是base64编码过的线路信息文本
    interval: 86400
    path: ./profiles/provider1 # 文件名不要加后缀
    filter: ^(?!.*刷新)(?!.*计量).*$
    health-check:
      enable: true
      interval: 3600
      lazy: true
      url: https://www.google.com/humans.txt
lesca commented 1 year ago

参考 clash 的文档: https://lancellc.gitbook.io/clash/clash-config-file/proxy-provider