本帖最后由 twentyone 于 2022-8-12 00:29 编辑
大佬帖子 https://hostloc.com/forum.php?mod=viewthread&tid=1059296
看了一下,分享一下分流规则
X-UI
- {
- "api": {
- "services": [
- "HandlerService",
- "LoggerService",
- "StatsService"
- ],
- "tag": "api"
- },
- "inbounds": [
- {
- "listen": "127.0.0.1",
- "port": 62789,
- "protocol": "dokodemo-door",
- "settings": {
- "address": "127.0.0.1"
- },
- "tag": "api"
- }
- ],
- "outbounds": [
- {
- "tag":"free",
- "protocol": "freedom",
- "settings": {}
- },
-
- {
- "tag": "GoLaoyizi",
- "protocol": "vmess",
- "streamSettings": {
- "network": "ws",
- "security": "tls",
- "tlsSettings": {
- "allowInsecure": false
- },
- "wsSettings": {
- "path": "ws"
- }
- },
- "mux": {
- "enabled": true,
- "concurrency": 8
- },
- "settings": {
- "vnext": [
- {
- "address": "自己改",
- "port": 443,
- "users": [
- {
- "id": "自己改",
- "security": "auto",
- "alterId": 0
- }
- ]
- }
- ]
- }
- }
- ],
- "routing": {
- "rules": [
- {
- "type": "field",
- "outboundTag": "GoLaoyizi",
- "domain": ["geosite:netflix","geoip:netflix","geosite:disney","geoip:disney","cdn.registerdisney.go.com","disneyplus.com","disney-plus.net","dssott.com","bamgrid.com","execute-api.us-east-1.amazonaws.com","global.edge.bamgrid.com"]
- },
- {
- "type": "field",
- "outboundTag": "free",
- "network": "udp,tcp"
- }
- ]
- }
- }
复制代码
八合一脚本
- #编辑文件
- vim /etc/V2-agent/xray/conf/09_routing.json
-
- #修改为以下内容
- {
- "routing": {
- "domainStrategy": "AsIs",
- "rules": [
- {
- "type": "field",
- "outboundTag": "GoLaoyizi",
- "domain": ["geosite:netflix","geoip:netflix","geosite:disney","geoip:disney","cdn.registerdisney.go.com","disneyplus.com","disney-plus.net","dssott.com","bamgrid.com","execute-api.us-east-1.amazonaws.com","global.edge.bamgrid.com"]
- },
- {
- "type": "field",
- "outboundTag": "free",
- "network": "udp,tcp"
- }
- ]
- }
- }
-
- #编辑文件
- vim /etc/V2-agent/xray/conf/10_ipv4_outbounds.json
-
- #修改为以下内容
- {
- "outbounds": [
- {
- "tag":"free",
- "protocol": "freedom",
- "settings": {}
- },
- {
- "tag": "GoLaoyizi",
- "protocol": "vmess",
- "streamSettings": {
- "network": "ws",
- "security": "tls",
- "tlsSettings": {
- "allowInsecure": false
- },
- "wsSettings": {
- "path": "ws"
- }
- },
- "mux": {
- "enabled": true,
- "concurrency": 8
- },
- "settings": {
- "vnext": [
- {
- "address": "自己改",
- "port": 443,
- "users": [
- {
- "id": "自己改",
- "security": "auto",
- "alterId": 0
- }
- ]
- }
- ]
- }
- }
- ]
- }
-
- #重启
- reboot
复制代码
wulabing
-
- #打开配置文件
- vim /usr/local/etc/xray/config.json
-
- #修改为以下内容
- {
- "log": {
- "access": "/var/log/xray/access.log",
- "error": "/var/log/xray/error.log",
- "loglevel": "warning"
- },
- "inbounds": [
- {
- "port": 41407,
- "listen": "127.0.0.1",
- "tag": "VLESS-in",
- "protocol": "VLESS",
- "settings": {
- "clients": [
- {
- "id": "安装时生成的id",
- "alterId": 0
- }
- ],
- "decryption": "none"
- },
- "streamSettings": {
- "network": "ws",
- "wsSettings": {
- "path": "/生成的路径/"
- }
- }
- }
- ],
- "outbounds": [
- {
- "tag":"free",
- "protocol": "freedom",
- "settings": {}
- },
- {
- "tag": "GoLaoyizi",
- "protocol": "vmess",
- "streamSettings": {
- "network": "ws",
- "security": "tls",
- "tlsSettings": {
- "allowInsecure": false
- },
- "wsSettings": {
- "path": "ws"
- }
- },
- "mux": {
- "enabled": true,
- "concurrency": 8
- },
- "settings": {
- "vnext": [
- {
- "address": "自己改",
- "port": 443,
- "users": [
- {
- "id": "自己改",
- "security": "auto",
- "alterId": 0
- }
- ]
- }
- ]
- }
- }
- ],
- "dns": {
- "servers": [
- "https+local://1.1.1.1/dns-query",
- "1.1.1.1",
- "1.0.0.1",
- "8.8.8.8",
- "8.8.4.4",
- "localhost"
- ]
- },
- "routing": {
- "domainStrategy": "AsIs",
- "rules": [
- {
- "type": "field",
- "outboundTag": "GoLaoyizi",
- "domain": ["geosite:netflix","geoip:netflix","geosite:disney","geoip:disney","cdn.registerdisney.go.com","disneyplus.com","disney-plus.net","dssott.com","bamgrid.com","execute-api.us-east-1.amazonaws.com","global.edge.bamgrid.com"]
- },
- {
- "type": "field",
- "outboundTag": "free",
- "network": "udp,tcp"
- }
- ]
- }
- }
-
- #重启
- reboot
复制代码
关于分流,常用的outbound配置
-
- #SS
- {
- "protocol": "’55R’",
- "settings": {
- "servers": [
- {
- "address": "自己改",
- "method": "自己改(如chacha20-ietf-poly1305",
- "ota": false,
- "password": "自己改",
- "port": 自己改
- }
- ]
- },
- "tag": "自己改"
- }
-
- #socks
- {
- "tag": "自己改",
- "protocol": "socks",
- "settings": {
- "servers": [
- {
- "address": "自己改",
- "port": 自己改,
- "users": []
- }
- ]
- }
- }
- #vmess等
- 见上
-
- #ipv4 v6出站,双栈网络下 IPv6优先级更高
- {
- "tag":"IP4-out",
- "protocol": "freedom",
- "settings": {}
- },
- {
- "tag":"IP6-out",
- "protocol": "freedom",
- "settings": {
- "domainStrategy": "UseIPv6"
- }
-
复制代码
关于vim,按i进入编辑模式,编辑好了按ESC,输入 :wq 然后enter 即可保存退出
毕竟不是自己服务器,我把address与id留空了,请自己修改添加
|