xmdhs / clash2singbox Goto Github PK
View Code? Open in Web Editor NEW将 clash.meta 格式的配置文件或链接转换为 sing-box 格式
Home Page: https://clash2sfa.xmdhs.com
License: MIT License
将 clash.meta 格式的配置文件或链接转换为 sing-box 格式
Home Page: https://clash2sfa.xmdhs.com
License: MIT License
Proxy daisy chain not implement.
没有实现链式代理转换, 以下是脱敏后的原始Clash配置文件:
log-level: error
mode: rule
ipv6: true
unified-delay: true
tcp-concurrent: true
allow-lan: true
bind-address: "*"
mixed-port: 57890
external-controller: 127.0.0.1:59090
global-client-fingerprint: safari
global-ua: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15"
dns:
enable: true
ipv6: true
listen: 0.0.0.0:5****
enhanced-mode: fake-ip
fake-ip-range: 10.10.255.1/24
fake-ip-filter: ['stun.*.*.*', 'stun.*.*']
default-nameserver: [1.1.1.1, 8.8.8.8, '2606:4700:4700::1111', '2001:4860:4860::8888']
nameserver: [https://dns.opendns.com/dns-query, https://dns10.quad9.net/dns-query]
proxy-server-nameserver: [https://dns.k******.net/dns-query, https://gateway.k******.net/dns-query]
rules:
- MATCH,SELECT-HERE(Global)
proxy-groups:
# DEFINE PROXYCHAIN
- { name: SELECT-HERE(Global), type: select, url: 'http://cp.cloudflare.com', proxies: [US, JP] }
- { name: NO "Direct" IN CHINA, type: select, proxies: [REJECTME] }
- { name: -------IGNORE BELOW-------, type: relay, hidden: true, proxies: [REJECTME] }
- { name: US, type: relay, hidden: true, proxies: [A-SDWAN, Direct-US] }
- { name: JP, type: relay, hidden: true, proxies: [B-SDWAN, Direct-JP] } # Symmetric NAT
proxies:
# DEFINE REJECT
- { name: REJECTME, type: ss, server: localhost, port: 8388, cipher: aes-256-cfb, password: Barfoo!, udp: false, ip-version: ipv4 }
# DEFINE SDWAN
- { name: A-SDWAN, type: ss, server: sdwan1.k******.net, port: 1****, cipher: chacha20-ietf-poly1305, password: c*****, udp: true, udp-over-tcp: true, udp-over-tcp-version: 1, ip-version: ipv4 }
- { name: B-SDWAN, type: ss, server: sdwan2.k******.net, port: 1****, cipher: chacha20-ietf-poly1305, password: c*****, udp: true, udp-over-tcp: true, udp-over-tcp-version: 1, ip-version: ipv4 }
# DEFINE DIRECT
- { name: Direct-US, server: us1.k******.net, port: 6****, type: ss, cipher: aes-256-gcm, password: K******, udp: true, ip-version: ipv4 }
- { name: Direct-JP, server: jp1.k******.net, port: 6****, type: ss, cipher: aes-256-gcm, password: K******, udp: true, ip-version: ipv6 }
刚看到 https://github.com/xmdhs/clash2sfa 这个项目,不好意思。 close 了
无法直接使用,导入sing-box提示invalid message
rule_set 的 url 前建议加上 https://mirror.ghproxy.com/
变成 https://mirror.ghproxy.com/https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs
,不然会出现规则集文件无法下载导致卡死的情况
感谢作者提供的这个项目
比如clash配置文件中有这么一个ssr节点
proxies:
- name: HK-SSR
server: this.is.a.server
port: 15000
type: ssr
cipher: aes-256-cfb
password: ThisIsPassword
protocol: auth_aes128_sha1
obfs: http_simple
protocol-param: password
obfs-param: download.windowsupdate.com
udp: true
转换过后会变成
{
"password": "ThisIsPassword",
"server": "this.is.a.server",
"server_port": 15000,
"tag": "HK-SSR",
"type": "shadowsocksr",
"method": "aes-256-cfb",
"obfs": "http_simple",
"obfs_param": "download.windowsupdate.com",
"protocol_param": "password"
}
漏掉了一行"protocol": "auth_aes128_sha1"
测过本地编译的二进制和作者提供的在线转换网站,都是一样的结果,应该不是我操作问题
用命令 clash2singbox -url $sub_url -o config.json 常规的订阅url下载正常,但是遇到一个套娃式的url无法下载成功
报错信息:
[1] 718806
[2] 718807
[3] 718808
[2] Done insert=true
[4] 718809
[3] Done emoji=true
[5] 718811
[4] Done udp=true
bash: clash.doh=true: command not found
[6] 718815
[5]- Exit 127 clash.doh=true
[7] 718817
[6]- Done new_name=true
bash: -config.json: command not found
[7]+ Done filename=Flower_Trojan
希望给Direct更多的属性
[https://sing-box.sagernet.org/configuration/outbound/direct/]
希望只是检测有无type:block,dns,direct,而不是替换为默认值
"transport": {
"headers": {
"Host": [
"baidu.com"
]
},
"path": "/123",
"type": "ws"
}
--nodeonly
启用这个参数时只导出节点,例如:
[
{
"password": "xxxxx",
"server": "xxxxxx",
"server_port": 56001,
"tag": "Hong Kong-01",
"type": "shadowsocks",
"method": "chacha20-ietf-poly1305"
},
{
"password": "yyyyy",
"server": "yyyyyyyyyy",
"server_port": 56002,
"tag": "Hong Kong-02",
"type": "shadowsocks",
"method": "chacha20-ietf-poly1305"
}
]
因为有的订阅不通过代理不能访问,所以希望能支持添加代理
添加参数如: -x socks5://127.0.0.1:7890
如下将筛选出的节点加上 "detour": "落地1"
{
"server": "172.0.0.77",
"server_port": 9090,
"tag": "落地1",
"type": "ss"
},
{
"tag": "中继落地1",
"type": "selector",
"outbounds": [
"include: hk|HK|港|IEPL|iepl|IPLC|iplc"
],
"detour": "落地1"
}
请问怎么套娃,比如我添加了一个香港代理组,我另一个代理组需要包含香港代理组。谢谢。
大佬vless转换的时候丢掉了 "fingerprint": "chrome"信息,转换完成我手动加上 "fingerprint": "chrome"这条信息就正常了。
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.