Last active
October 7, 2022 08:56
-
-
Save KevinMX/d1a2a75215504e51e5665a52de70dcd7 to your computer and use it in GitHub Desktop.
[experimental] sing-box for trojan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"log": { | |
"level": "info" | |
}, | |
"dns": { | |
"servers": [ | |
{ | |
"tag": "cloudflare", | |
"address": "tls://1.1.1.1" | |
}, | |
{ | |
"tag": "local", | |
"address": "tls://119.29.29.29", | |
"detour": "direct" | |
} | |
], | |
"rules": [ | |
{ | |
"domain": "your-server.domain", | |
"geosite": "cn", | |
"server": "local" | |
} | |
], | |
"strategy": "ipv4_only" | |
}, | |
"inbounds": [ | |
{ | |
"type": "socks", | |
"tag": "socks-in", | |
"listen": "::", | |
"listen_port": 1080 | |
} | |
], | |
"outbounds": [ | |
{ | |
"type": "trojan", | |
"tag": "trojan-out", | |
"server": "your-server-ip", | |
"server_port": 443, | |
"password": "your-password", | |
"tls": { | |
"enabled": true, | |
"disable_sni": false, | |
"server_name": "your-server.domain", | |
"insecure": false, | |
"alpn": [ | |
"http/1.1","h2" | |
], | |
"ech": { | |
"enabled": false | |
}, | |
"utls": { | |
"enabled": true, | |
"fingerprint": "chrome" | |
} | |
} | |
}, | |
{ | |
"type": "direct", | |
"tag": "direct" | |
}, | |
{ | |
"type": "block", | |
"tag": "block" | |
} | |
], | |
"route": { | |
"rules": [ | |
{ | |
"geosite": "cn", | |
"geoip": "cn", | |
"outbound": "direct" | |
}, | |
{ | |
"geosite": "category-ads-all", | |
"outbound": "block" | |
}, | |
{ | |
"geosite": "google", | |
"geoip": "google", | |
"outbound": "trojan-out" | |
}, | |
] | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"log": { | |
"level": "info" | |
}, | |
"dns": { | |
"servers": [ | |
{ | |
"tag": "cloudflare", | |
"address": "tls://1.1.1.1" | |
} | |
] | |
}, | |
"inbounds": [ | |
{ | |
"type": "trojan", | |
"listen": "::", | |
"listen_port": 443, | |
"users": [ | |
{ | |
"password": "your-password" | |
} | |
], | |
"tls": { | |
"enabled": true, | |
"alpn": [ | |
"http/1.1", | |
"h2" | |
], | |
"min_version": "1.3", | |
"acme": { | |
"domain": "your.domain", | |
"email": "your@email", | |
"data_directory": "/usr/local/etc/sing-box", | |
"provider": "letsencrypt" | |
} | |
} | |
} | |
], | |
"outbounds": [ | |
{ | |
"type": "direct", | |
"tag": "direct" | |
}, | |
{ | |
"type": "block", | |
"tag": "block" | |
}, | |
{ | |
"type": "dns", | |
"tag": "dns-out" | |
} | |
], | |
"route": { | |
"rules": [ | |
{ | |
"protocol": "dns", | |
"outbound": "dns-out" | |
}, | |
{ | |
"geosite": "cn", | |
"geoip": "cn", | |
"outbound": "block" | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment