xmdhs / clash2sfa Goto Github PK
View Code? Open in Web Editor NEW将 Clash.Meta 格式的订阅链接转换为 sing-box 格式的订阅,用于 SFA
Home Page: https://clash2sfa.xmdhs.com
License: MIT License
将 Clash.Meta 格式的订阅链接转换为 sing-box 格式的订阅,用于 SFA
Home Page: https://clash2sfa.xmdhs.com
License: MIT License
支持从配置文件中解析proxy_provider中的节点
配置文件报错
GetSub: convert2sing: clash2sing: vless: Flow 不支持的类型
Clash文件格式
proxies:
- name: demo
server: demo.com
port: 10001
type: vless
uuid: xxx-xxx-xxx-xxx-xxxx
flow: none
udp: true
tls: true
network: tcp
ws-opts:
path: ""
headers:
Host: ""
rule-providers:
xxxxx
服务端是xray1.7.5,流控是none,vision二选一
对模板dns地址的修改不会保存
大佬,我用默认配置模板发现机场部分节点明明解锁 netflix 但是却只能看自制剧
后来在电报群里请教发现要在
1.inbounds里把"domain_strategy": "ipv4_only",去掉
2.在 "dns": {
"servers": [
{
"tag": "remote",
"address": "https:1.1.1.1/dns-query",
"detour": "select"
},
{
"tag": "local",
"address": "https:223.5.5.5/dns-query",
"Detour": "direct"
}
],
"rules" means: [
{
"clash_mode": "global",
加上 "ip_version": 4,
"server": "remote"
},
这样节点就正常了
还有一件小事就是大佬能不能顺手加上在模版上加上 clash api fakeip 相关配置啊,听说这样网能快点。我看 1.3.0 支持了。馋的慌(主要是我还不太会写🤪🤣)
template:
"outbounds": [
{
"type": "selector",
"tag": "proxy",
"outbounds": [
"exclude: (Traffic Reset|Expire Date|GB |直连|回国)"
]
},
{
"type": "selector",
"tag": "paypal us",
"outbounds": [
"include: (United States|US)",
"proxy"
]
},
{
"type": "dns",
"tag": "dns-out"
}
],
output:
},
{
"tag": "direct",
"type": "direct"
},
{
"tag": "block",
"type": "block"
},
{
"tag": "dns-out",
"type": "dns"
},
{
"outbounds": [
"1111",
"222",
"dns-out"
],
"tag": "proxy",
"type": "selector"
},
{
"outbounds": [
"proxy"
],
"tag": "paypal us",
"type": "selector"
},
{
"tag": "dns-out",
"type": "dns"
}
],
最终无法启动
我试过本地docker安装的转换工具使用作者你提供的1.80的模版直链,发现不能转换提示错误,后来全局开启tun就行了,我在想能不能把模版下载到本地,再通过一些软件的本地映射实现呢?
如果把自定义节点规则添加进select组,这样就不能自定义一些规则,会造成套娃无法使用。比如我想增加一个奈飞的组就无法添加了。
此前使用並未發生問題,今次sing-box自動更新後發生錯誤。
使用demo網站:
https://clash2sfa-xmdhs.koyeb.app
轉換後,添加sing-box訂閱地址報錯信息如下:
sing-box發生錯誤的版本為:
但使用sub-web-modify專案:
https://github.com/youshandefeiyang/sub-web-modify
轉換後的訂閱地址可以正常使用。
因此推測是sing-box更新後,排除是sing-box的問題,而是本專案需要進行一定的更新。
能否处理下 mihomo 里的 tfo 和 mptcp 参数
docker内容的更新是自动的吗,还是需要一些特别的操作,需要用tun的代理模式吗?
报错:
GetSub: convert2sing: clash2sing: hysteria: 不支持的类型
https://koumakan-tools.102498.xyz/api/v1/client/subscribe?token=fa9729f4a855a8e6e542364bc90d6556
我的这个机场链接无法筛选**节点。
模板如下
仅一次成功过,是urltest包含那个选项我就填了个港
不支持的类型:vless:flow
转换过来后,包名规则的顺序颠倒了: {
"outbound": "ytm",
"package_name": [
"com.google.android.apps.youtube.music",
"app.revanced.android.apps.youtube.music"
]
},
我的链接是https://xxxxxxxxxxxxxxxxxxxxxxx&flag=clash.
我在浏览器输入我的链接直接是下载yaml文件
作者,你做的的这个东西很适合和Nekobox合作呢
应该是我的配置写错了。但不知道该怎么写。目的是为了不同网站走不同节点。
{
"log": {},
"dns": {
"servers": [
{
"tag": "remote",
"address": "tcp://1.1.1.1",
"detour": "select"
},
{
"tag": "local",
"address": "https://223.5.5.5/dns-query",
"detour": "direct"
},
{
"address": "rcode://success",
"tag": "block"
}
],
"rules": [
{
"outbound": [
"any"
],
"server": "local"
},
{
"disable_cache": true,
"geosite": [
"category-ads-all"
],
"server": "block"
},
{
"clash_mode": "global",
"server": "remote"
},
{
"clash_mode": "direct",
"server": "local"
},
{
"geosite": "cn",
"server": "local"
}
],
"strategy": "prefer_ipv4"
},
"inbounds": [
{
"type": "tun",
"inet4_address": "172.19.0.1/30",
"inet6_address": "2001:0470:f9da:fdfa::1/64",
"sniff": true,
"sniff_override_destination": true,
"domain_strategy": "prefer_ipv4",
"stack": "mixed",
"strict_route": true,
"mtu": 9000,
"endpoint_independent_nat": true,
"auto_route": true
},
{
"type": "socks",
"tag": "socks-in",
"listen": "127.0.0.1",
"sniff": true,
"sniff_override_destination": true,
"domain_strategy": "prefer_ipv4",
"listen_port": 2333,
"users": []
},
{
"type": "mixed",
"tag": "mixed-in",
"sniff": true,
"sniff_override_destination": true,
"domain_strategy": "prefer_ipv4",
"listen": "127.0.0.1",
"listen_port": 2334,
"users": []
}
],
"outbounds": [
{
"type": "direct",
"tag": "direct"
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
},
{
"tag":" Google",
"type":"selector",
"outbounds":[
"direct",
"select"
]
"filter":[
{"action":"include","keywords":["🇹🇼","TW","tw","**","🇸🇬","SG","sg","新加坡","狮","🇯🇵","jp","JP","日本","🇺🇸","us","US","美国"}
]
}
],
"route": {
"rules": [
{
"geosite": "category-ads-all",
"outbound": "block"
},
{
"protocol": "dns",
"outbound": "dns-out"
},
{
"clash_mode": "direct",
"outbound": "direct"
},
{
"clash_mode": "global",
"outbound": "select"
},
{
"geoip": [
"cn",
"private"
],
"outbound": "direct"
},
{
"geosite": "cn",
"outbound": "direct"
},
{
"geoip":"google",
"geosite":["google"],
"outbound":" Google"
},
],
"auto_detect_interface": true
},
"experimental": {
"clash_api": {
"external_controller": "127.0.0.1:9091",
"store_selected": true,
"secret": ""
}
}
}
大佬能不能在分流中加上 disney 和 netflix 啊
我看 sing-box 文档 rule 默认的好像还不行。
好像要用增强版的。
netflix 和 disney能正则筛选 ip 就太棒了建议用Selector 不然跳 ip 的话影响观看体验
谢谢大佬
以下是clash配置文件里一段规则,貌似无法在转换后的sing-box配置文件里体现
# Local Area Network
- DOMAIN-KEYWORD,announce,DIRECT
- DOMAIN-KEYWORD,torrent,DIRECT
- DOMAIN-KEYWORD,tracker,DIRECT
- DOMAIN-SUFFIX,smtp,DIRECT
- DOMAIN-SUFFIX,local,DIRECT
- IP-CIDR,192.168.0.0/16,DIRECT
- IP-CIDR,10.0.0.0/8,DIRECT
- IP-CIDR,172.16.0.0/12,DIRECT
- IP-CIDR,127.0.0.0/8,DIRECT
- IP-CIDR,100.64.0.0/10,DIRECT
如果这段规则没有的话,我就无法在内网中跟其他设备直连
meta配置信息 secret: "xxxxxxxx"
转换后成了 "secret": "" 密码没了
没有打开禁用默认生成的 urltest 和 selector 且模版存在
{
"type": "selector",
"tag": "select",
"outbounds": [
"exclude: (Traffic Reset|Expire Date|GB |直连|回国)"
]
},
但转出来就是同时存在两个 tag 为 select 的 selector,这样就会无法启动
"outbounds": [
{
"tag": "select",
"type": "selector",
"default": "urltest",
"outbounds": [
"urltest",
"a",
"b"
]
},
{
"tag": "urltest",
"type": "urltest",
"outbounds": [
"a",
"b"
]
},
{
"outbounds": [
"a",
"b"
],
"tag": "select",
"type": "selector"
},
虽然直接禁止生成默认可以避免但是还是会有用同一个模版但有些订阅需要 urltest 的
自己修改的模板
"outbounds": [
{
"type": "direct",
"tag": "Direct"
},
{
"type": "dns",
"tag": "dns-out"
},
{
"type": "block",
"tag": "Block"
}
]
经转换后
outbounds": [
{
"tag": "direct",
"type": "direct"
},
{
"tag": "block",
"type": "block"
},
{
"tag": "dns-out",
"type": "dns"
}
]
首先非常感谢作者的项目!
我是想完全自定义 配置文件模板 和 urltest / selector,但是转化器会自动加上下面两种 outbounds。我在想能不能在用户使用自定义 urltest / selector 时,不自动加上这些 outbounds?或者是有个选项,让用户自行选择是否加入这些 outbounds。
{
"default": "urltest",
"outbounds": ["XXX"],
"tag": "select",
"type": "selector"
}
{
"outbounds": ["XXX"],
"tag": "urltest",
"type": "urltest"
}
机场提供的订阅服务多数使用CF的CDN服务,但是请求只能来自**IP,其他国家/地区无法访问订阅。然后感觉设置的超时时间太短,在宿主机上使用curl等工具也是能够获取到订阅,只是等待时间较长。
能否保持输入模版的结构顺序
浏览器单独下载订阅配置,查看里包含hy2节点。使用同一链接转换后新的配置内不存在h2节点
原节点结构:
alpn:
- h3
name: ""
password:
port:
server:
skip-cert-verify: true
sni:
type: hysteria2
udp: true
希望给Direct更多的属性
[https://sing-box.sagernet.org/configuration/outbound/direct/]
希望只是检测有无type:block,dns,direct,而不是替换为默认值
浏览器报错:TypeError: undefined is not an object (evaluating 'navigator.clipboard.writeText')
转换带有tuic节点的链接,能正常生成,然后导入sing-box则直接提示
(packet-tunnel) error: create service: create service: parse outbound[12]: TLS required
decode config at : outbound options: json: unknown field "obfs"
sing-box配置的节点中没有obfs导致无法启动
smux:
enabled: true
protocol: smux
并没有被转换成
"multiplex": {
"enabled": true,
"protocol": "smux"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.