自建Vless + Reality协议 + Vision流控和Hysteria2,歇斯底里和Reality多客户端v2rayn+sing-box+小火箭+box for magisk配置教程

1、安装部署x-ui面板

bash <(curl -Ls https://raw.githubusercontent.com/FranzKafkaYu/x-ui/master/install.sh)

登陆面板添加入站

以上设置reality 打开,流控(flow)选择xtls-rprx-vision就可以了。

2、安装部署Hysteria2

wget -N --no-check-certificate https://raw.githubusercontent.com/flame1ce/hysteria2-install/main/hysteria2-install-main/hy2/hysteria.sh && bash hysteria.sh

如果没有域名用自签证书;

有域名可用acme申请证书(要求域名已针对vps的IP做了A记录解析,cloudflare解析先关闭小云朵),也可以用cloudflare的证书,下载后放到服务器目录然后选择自有证书输入证书路径即可。

mace生成证书报错访问授权请输入

sudo chmod +r /root/private.key

hysteria 2.0是UDP传输,所以要开通服务器端的UDP监听端口,如:

sudo ufw allow 8787/udp

hysteria 2.0命令:

#启动Hysteria2 
systemctl start hysteria-server.service 
#重启Hysteria2 
systemctl restart hysteria-server.service 
#查看Hysteria2状态 
systemctl status hysteria-server.service 
#停止Hysteria2 
systemctl stop hysteria-server.service 
#设置开机自启 
systemctl enable hysteria-server.service 
#查看日志 
journalctl -u hysteria-server.service

3、配置sing-box

这里以box for magisk配置为例,先用MT管理器进入/data/adb/box/sing-box的config.json修改配置文件,这里手搓测试Vless + Reality协议和hysteria2等都能正常使用,参考如下:

{
  "log": {
    "level": "info",
    "timestamp": true
  },
  "dns": {
    "servers": [
      {
        "tag": "proxyDns",
        "address": "https://8.8.8.8/dns-query",
        "detour": "proxy"
      },
      {
        "tag": "localDns",
        "address": "https://223.5.5.5/dns-query",
        "detour": "direct"
      },
      {
        "tag": "block",
        "address": "rcode://success"
      }
    ],
    "rules": [
      {
        "domain": [
          "ghproxy.com",
          "cdn.jsdelivr.net",
          "testingcf.jsdelivr.net"
        ],
        "server": "localDns"
      },
      {
        "rule_set": "geosite-category-ads-all",
        "server": "block"
      },
      {
        "outbound": "any",
        "server": "localDns",
        "disable_cache": true
      },
      {
        "rule_set": "geosite-cn",
        "server": "localDns"
      },
      {
        "clash_mode": "direct",
        "server": "localDns"
      },
      {
        "clash_mode": "global",
        "server": "proxyDns"
      },
      {
        "rule_set": "geosite-geolocation-!cn",
        "server": "proxyDns"
      }
    ],
    "strategy": "ipv4_only"
  },
  "inbounds": [
    {
      "type": "tun",
      "mtu": 9000,
      "inet4_address": "172.19.0.1/30",
      "auto_route": false,
      "strict_route": true,
      "stack": "system",
      "platform": {
        "http_proxy": {
          "enabled": true,
          "server": "127.0.0.1",
          "server_port": 2080
        }
      },
      "sniff": true
    },
    {
      "type": "mixed",
      "listen": "127.0.0.1",
      "listen_port": 2080,
      "sniff": true
    },
    {
      "type": "tproxy",
      "tag": "tproxy-in",
      "listen": "::",
      "listen_port": 9898,
      "sniff": true
    }
  ],
  "outbounds": [
    {
      "type": "selector",
      "tag": "proxy",
      "outbounds": [
        "auto",
        "direct",
        "SV1_vless",
        "los",
        "usazhong",
        "angeles"
      ]
    },
    {
      "type": "selector",
      "tag": "🤖 OpenAI",
      "outbounds": [
        "🇹🇼 台湾节点",
        "🇸🇬 狮城节点",
        "🇯🇵 日本节点",
        "🇺🇸 美国节点",
        "✈️ 其他节点"
      ]
    },
    {
      "type": "selector",
      "tag": "🌌 Google",
      "outbounds": [
        "🇭🇰 香港节点",
        "🇹🇼 台湾节点",
        "🇸🇬 狮城节点",
        "🇯🇵 日本节点",
        "🇺🇸 美国节点",
        "✈️ 其他节点"
      ]
    },
    {
      "type": "selector",
      "tag": "📟 Telegram",
      "outbounds": [
        "🇭🇰 香港节点",
        "🇹🇼 台湾节点",
        "🇸🇬 狮城节点",
        "🇯🇵 日本节点",
        "🇺🇸 美国节点",
        "✈️ 其他节点"
      ]
    },
    {
      "type": "selector",
      "tag": "🐦 Twitter",
      "outbounds": [
        "🇭🇰 香港节点",
        "🇹🇼 台湾节点",
        "🇸🇬 狮城节点",
        "🇯🇵 日本节点",
        "🇺🇸 美国节点",
        "✈️ 其他节点"
      ]
    },
    {
      "type": "selector",
      "tag": "👤 Facebook",
      "outbounds": [
        "🇭🇰 香港节点",
        "🇹🇼 台湾节点",
        "🇸🇬 狮城节点",
        "🇯🇵 日本节点",
        "🇺🇸 美国节点",
        "✈️ 其他节点"
      ]
    },
    {
      "type": "selector",
      "tag": "🛍️ Amazon",
      "outbounds": [
        "direct",
        "🇭🇰 香港节点",
        "🇹🇼 台湾节点",
        "🇸🇬 狮城节点",
        "🇯🇵 日本节点",
        "🇺🇸 美国节点",
        "✈️ 其他节点"
      ]
    },
    {
      "type": "selector",
      "tag": "🍎 Apple",
      "outbounds": [
        "direct",
        "🇭🇰 香港节点",
        "🇹🇼 台湾节点",
        "🇸🇬 狮城节点",
        "🇯🇵 日本节点",
        "🇺🇸 美国节点",
        "✈️ 其他节点"
      ]
    },
    {
      "type": "selector",
      "tag": "🧩 Microsoft",
      "outbounds": [
        "direct",
        "🇭🇰 香港节点",
        "🇹🇼 台湾节点",
        "🇸🇬 狮城节点",
        "🇯🇵 日本节点",
        "🇺🇸 美国节点",
        "✈️ 其他节点"
      ]
    },
    {
      "type": "selector",
      "tag": "🎮 Game",
      "outbounds": [
        "direct",
        "🇭🇰 香港节点",
        "🇹🇼 台湾节点",
        "🇸🇬 狮城节点",
        "🇯🇵 日本节点",
        "🇺🇸 美国节点",
        "✈️ 其他节点"
      ]
    },
    {
      "type": "selector",
      "tag": "📺 Bilibili",
      "outbounds": [
        "direct",
        "🇭🇰 香港节点",
        "🇹🇼 台湾节点"
      ]
    },
    {
      "type": "selector",
      "tag": "🎬 MediaVideo",
      "outbounds": [
        "🇭🇰 香港节点",
        "🇹🇼 台湾节点",
        "🇸🇬 狮城节点",
        "🇯🇵 日本节点",
        "🇺🇸 美国节点",
        "✈️ 其他节点"
      ]
    },
    {
      "type": "selector",
      "tag": "🌏 !cn",
      "outbounds": [
        "direct",
        "🇭🇰 香港节点",
        "🇹🇼 台湾节点",
        "🇸🇬 狮城节点",
        "🇯🇵 日本节点",
        "🇺🇸 美国节点",
        "✈️ 其他节点"
      ]
    },
    {
      "type": "selector",
      "tag": "🇭🇰 香港节点",
      "outbounds": [
        "proxy"
      ]
    },
    {
      "type": "selector",
      "tag": "🇹🇼 台湾节点",
      "outbounds": [
        "proxy"
      ]
    },
    {
      "type": "selector",
      "tag": "🇸🇬 狮城节点",
      "outbounds": [
        "SV1_vless",
        "los",
        "usazhong",
        "angeles",
        "proxy"
      ]
    },
    {
      "type": "selector",
      "tag": "🇯🇵 日本节点",
      "outbounds": [
        "proxy"
      ]
    },
    {
      "type": "selector",
      "tag": "🇺🇸 美国节点",
      "outbounds": [
        "proxy"
      ]
    },
    {
      "type": "selector",
      "tag": "✈️ 其他节点",
      "outbounds": [
        "proxy"
      ]
    },
    {
      "type": "selector",
      "tag": "🌏 cn",
      "outbounds": [
        "direct",
        "proxy"
      ]
    },
    {
      "type": "selector",
      "tag": "🛑 AdBlock",
      "outbounds": [
        "block",
        "direct"
      ]
    },
    {
      "type": "urltest",
      "tag": "auto",
      "outbounds": [
        "SV1_vless",
        "los",
        "usazhong",
        "angeles"
      ],
      "url": "http://www.gstatic.com/generate_204",
      "interval": "10m0s",
      "tolerance": 50
    },
    {
      "type": "direct",
      "tag": "direct"
    },
    {
      "type": "dns",
      "tag": "dns-out"
    },
    {
      "type": "block",
      "tag": "block"
    },
    {
      "type": "vless",
      "tag": "SV1_vless",
      "server": "www.visa.com.tw", //修改优选ip或域名
        "server_port": 80, //端口可更改为80 8080 8880 2052 2086 2095
        "uuid": "d342d11e-d424-4283-b33e-524ab1f0ada4", //修改你的uuid
        "packet_encoding": "xudp",
        "transport": {
          "type": "ws",
          "path": "/",
          "headers": {
            "Host": "111.bwvd9gh5.workers.dev" //修改你的host
          },
          "early_data_header_name": "Sec-WebSocket-Protocol",
          "max_early_data": 2048
        }
      },
    {
      "type": "hysteria2",
      "tag": "los",
      "server": "129.184.143.161",
      "server_port": 24614,
      "up_mbps": 30,
      "down_mbps": 150,
      "password": "echgee0a",
      "tls": {
        "enabled": true,
        "server_name": "www.bing.com",
        "insecure": true,
        "alpn": "h3"
      }
    },
    {
      "type": "vless",
      "tag": "usazhong",
      "server": "v.xui.eu.org",
      "server_port": 443,
      "uuid": "185ds43c-25fa-45c5-58146-f99jkd2f4a76",
      "tls": {
        "enabled": true,
        "server_name": "v.xui.eu.org"
      },
      "transport": {
        "type": "ws",
        "path": "/vless"
      },
      "packet_encoding": ""
    },
    {
      "type": "vless",
      "tag": "angeles",
      "server": "129.184.143.161",
      "server_port": 23118,
      "uuid": "d9087fgd-d523-4v65-f6c7-53c0dfgh7738",
      "flow": "xtls-rprx-vision",
      "tls": {
        "enabled": true,
        "server_name": "www.tesla.com",
        "utls": {
          "enabled": true,
          "fingerprint": "chrome"
        },
        "reality": {
          "enabled": true,
          "public_key": "UtL7E0jhgg3X5JdcfgjukiTRKo7K2wdgrg0vwk2XroUM",
          "short_id": "b2c86d2579d896fa"
        }
      },
      "packet_encoding": "xudp"
    }
  ],
  "route": {
    "rules": [
      {
        "protocol": "dns",
        "outbound": "dns-out"
      },
      {
        "network": "udp",
        "port": 443,
        "outbound": "block"
      },
      {
        "rule_set": "geosite-category-ads-all",
        "outbound": "🛑 AdBlock"
      },
      {
        "clash_mode": "direct",
        "outbound": "direct"
      },
      {
        "clash_mode": "global",
        "outbound": "proxy"
      },
      {
        "domain": [
          "clash.razord.top",
          "yacd.metacubex.one",
          "yacd.haishan.me",
          "d.metacubex.one"
        ],
        "outbound": "direct"
      },
      {
        "rule_set": "geosite-openai",
        "outbound": "🤖 OpenAI"
      },
      {
        "rule_set": "geosite-youtube",
        "outbound": "🌌 Google"
      },
      {
        "rule_set": "geoip-google",
        "outbound": "🌌 Google"
      },
      {
        "rule_set": [
          "geosite-google",
          "geosite-github"
        ],
        "outbound": "🌌 Google"
      },
      {
        "rule_set": "geoip-telegram",
        "outbound": "📟 Telegram"
      },
      {
        "rule_set": "geosite-telegram",
        "outbound": "📟 Telegram"
      },
      {
        "rule_set": "geoip-twitter",
        "outbound": "🐦 Twitter"
      },
      {
        "rule_set": "geosite-twitter",
        "outbound": "🐦 Twitter"
      },
      {
        "rule_set": "geoip-facebook",
        "outbound": "👤 Facebook"
      },
      {
        "rule_set": [
          "geosite-facebook",
          "geosite-instagram"
        ],
        "outbound": "👤 Facebook"
      },
      {
        "rule_set": "geosite-amazon",
        "outbound": "🛍️ Amazon"
      },
      {
        "rule_set": "geosite-apple",
        "outbound": "🍎 Apple"
      },
      {
        "rule_set": "geosite-microsoft",
        "outbound": "🧩 Microsoft"
      },
      {
        "rule_set": "geosite-category-games",
        "outbound": "🎮 Game"
      },
      {
        "rule_set": "geosite-bilibili",
        "outbound": "📺 Bilibili"
      },
      {
        "rule_set": "geoip-netflix",
        "outbound": "🎬 MediaVideo"
      },
      {
        "rule_set": [
          "geosite-tiktok",
          "geosite-netflix",
          "geosite-hbo",
          "geosite-disney",
          "geosite-primevideo"
        ],
        "outbound": "🎬 MediaVideo"
      },
      {
        "rule_set": "geosite-geolocation-!cn",
        "outbound": "🌏 !cn"
      },
      {
        "ip_is_private": true,
        "outbound": "🌏 cn"
      },
      {
        "rule_set": "geoip-cn",
        "outbound": "🌏 cn"
      },
      {
        "rule_set": "geosite-cn",
        "outbound": "🌏 cn"
      }
    ],
    "rule_set": [
      {
        "type": "remote",
        "tag": "geoip-google",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geoip/google.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geoip-telegram",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geoip/telegram.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geoip-twitter",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geoip/twitter.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geoip-facebook",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geoip/facebook.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geoip-netflix",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/MetaCubeX/meta-rules-dat/sing/geo/geoip/netflix.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geoip-cn",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geoip/rule-set/geoip-cn.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-openai",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-openai.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-youtube",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-youtube.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-google",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-google.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-github",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-github.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-telegram",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-telegram.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-twitter",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-twitter.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-facebook",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-facebook.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-instagram",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-instagram.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-amazon",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-amazon.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-apple",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-apple.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-microsoft",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-microsoft.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-category-games",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-games.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-bilibili",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-bilibili.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-tiktok",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-tiktok.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-netflix",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-netflix.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-hbo",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-hbo.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-disney",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-disney.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-primevideo",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-primevideo.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-cn",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-cn.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-geolocation-!cn",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-geolocation-!cn.srs",
        "download_detour": "auto"
      },
      {
        "type": "remote",
        "tag": "geosite-category-ads-all",
        "format": "binary",
        "url": "https://raw.githubusercontent.com/SagerNet/sing-geosite/rule-set/geosite-category-ads-all.srs",
        "download_detour": "auto"
      }
    ],
    "final": "proxy",
    "auto_detect_interface": false
  },
  "experimental": {
    "cache_file": {
      "enabled": true
    },
    "clash_api": {
      "external_controller": "127.0.0.1:9090",
      "external_ui": "ui",
      "default_mode": "rule"
    }
  }
}

然后用MT管理器进入/data/adb/box/settings.ini文件,将bin_name=”clash”改为bin_name=”sing-box”,黑名单模式下packages=list=(这里填你的国内APP包名)重启手机,登录127.0.0.1:9090/ui
后选择你需要的代理即可正常联网。

4、配置Shadowrocket小火箭

Reality协议在x-ui后台扫码即可,手工配置参考下图:

Hysteria2配置如下图:

5、配置v2rayN客服端

Reality协议在x-ui后台扫码或复制粘贴即可,手工配置参考下图:

Hysteria2配置先创建一个.json文件,内容修改成你自己的,参考如下:

{
"server": "198.26.238.139:58294,20000-50000",  //服务器IP及端口跳跃的范围
"auth": "d37c9633",   //密码
"tls": {
"sni": "www.bing.com",  //伪装域名
"insecure": true
},
"quic": {
"initStreamReceiveWindow": 16777216,
"maxStreamReceiveWindow": 16777216,
"initConnReceiveWindow": 33554432,
"maxConnReceiveWindow": 33554432
},
"socks5": {
"listen": "127.0.0.1:5678"
},
"transport": {
"udp": {
"hopInterval": "30s"
}
}
}

 

打开v2rayN点击服务器,添加自定义配置。别名随便写,地址打开你上面的.json配置文件,core类型选择Hysteria,socks端口选择配置文件里面的5678

6、配置Nekoray客户端

Reality协议在x-ui后台扫码或复制粘贴即可,具体可参考v2rayN.
Hysteria2参考下图

YouTube视频教程: