https://github.com/XTLS/REALITY#vless-xtls-utls-reality-example-for-xray-core-%E4%B8%AD%E6%96%87
我试了一下,没什么特别的,你们可以玩玩
配置里的 privateKey 和 publicKey 可以自己改改,生成方法./xray x25519
服务端安装 1.8.0 的脚本 (官方)
- bash -c “$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)” [url=home.php?mod=space&uid=175]@[/url] install –version 1.8.0
复制代码
客户端也要 1.8.0 https://github.com/XTLS/Xray-core/releases/tag/v1.8.0
服务端的一键脚本好弄,但是没必要,因为现在客户端都还不支持,反正都要手动的
然后把服务器配置写到 /usr/local/etc/xray/config.json 重启 xray systemctl restart xray
服务器配置
- {
- “inbounds”: [
- {
- “listen”: “0.0.0.0”,
- “port”: 443,
- “protocol”: “vless”,
- “settings”: {
- “clients”: [
- {
- “id”: “id”,
- “flow”: “xtls-rprx-vision”
- }
- ],
- “decryption”: “none”
- },
- “streamSettings”: {
- “network”: “tcp”,
- “security”: “reality”,
- “realitySettings”: {
- “show”: false,
- “dest”: “www.iq.com:443”,
- “xver”: 0,
- “serverNames”: [
- “www.iq.com”,
- “www.example.com”
- ],
- “privateKey”: “ANqmuHlwCv-KNWKe6-4sBOcL7Vedo4S45AOvTHRLOUU”,
- “minClientVer”: “”,
- “maxClientVer”: “”,
- “maxTimeDiff”: 0,
- “shortIds”: [
- “”,
- “0123456789abcdef”
- ]
- }
- }
- }
- ],
- “outbounds”: [
- {
- “protocol”: “freedom”,
- “settings”: {}
- }
- ]
- }
复制代码
客户端配置
保存为 json 文件,v2rayN 可以导入,其他客户端挑出 outbounds 那里自己改改
记得客户端也要手动升级到 1.8.0 版本
- {
- “policy”: {
- “system”: {
- “statsOutboundUplink”: true,
- “statsOutboundDownlink”: true
- }
- },
- “log”: {
- “access”: “”,
- “error”: “”,
- “loglevel”: “warning”
- },
- “inbounds”: [
- {
- “tag”: “socks2”,
- “port”: 10808,
- “listen”: “0.0.0.0”,
- “protocol”: “socks”,
- “sniffing”: {
- “enabled”: true,
- “destOverride”: [
- “http”,
- “tls”
- ]
- },
- “settings”: {
- “auth”: “noauth”,
- “udp”: true,
- “allowTransparent”: false
- }
- },
- {
- “tag”: “http2”,
- “port”: 10809,
- “listen”: “0.0.0.0”,
- “protocol”: “http”,
- “sniffing”: {
- “enabled”: true,
- “destOverride”: [
- “http”,
- “tls”
- ]
- },
- “settings”: {
- “auth”: “noauth”,
- “udp”: true,
- “allowTransparent”: false
- }
- },
- {
- “tag”: “api”,
- “port”: 3972,
- “listen”: “127.0.0.1”,
- “protocol”: “dokodemo-door”,
- “settings”: {
- “udp”: false,
- “address”: “127.0.0.1”,
- “allowTransparent”: false
- }
- }
- ],
- “outbounds”: [
- {
- “protocol”: “vless”,
- “settings”: {
- “vnext”: [
- {
- “address”: “ 你的服务器 IP”,
- “port”: 443,
- “users”: [
- {
- “id”: “id”,
- “flow”: “xtls-rprx-vision”,
- “encryption”: “none”
- }
- ]
- }
- ]
- },
- “streamSettings”: {
- “network”: “tcp”,
- “security”: “reality”,
- “realitySettings”: {
- “show”: false,
- “fingerprint”: “chrome”,
- “serverName”: “www.iq.com”,
- “publicKey”: “FU3taClalV6g2eB1cKe9OuVGyCEKd8iAFfVAsBE07wzA”,
- “shortId”: “”,
- “spiderX”: “”
- }
- }
- }
- ],
- “stats”: {},
- “api”: {
- “tag”: “api”,
- “services”: [
- “StatsService”
- ]
- },
- “dns”: {
- “servers”: [
- “223.5.5.5”,
- “8.8.8.8”
- ]
- },
- “routing”: {
- “domainStrategy”: “AsIs”,
- “domainMatcher”: “linear”,
- “rules”: [
- {
- “type”: “field”,
- “inboundTag”: [
- “api”
- ],
- “outboundTag”: “api”,
- “enabled”: true
- },
- {
- “type”: “field”,
- “inboundTag”: [],
- “outboundTag”: “proxy”,
- “domain”: [
- “translate.googleapis.com”,
- “translate.google.com”
- ],
- “enabled”: true
- },
- {
- “type”: “field”,
- “inboundTag”: [],
- “outboundTag”: “direct”,
- “domain”: [
- “domain:tencent.com”,
- “domain:qq.com”,
- “domain:baidu.com”,
- “domain:pan.baidu.com”
- ],
- “enabled”: true
- },
- {
- “type”: “field”,
- “outboundTag”: “direct”,
- “domain”: [
- “domain:example-example.com”,
- “domain:example-example2.com”
- ],
- “enabled”: true
- },
- {
- “type”: “field”,
- “outboundTag”: “block”,
- “domain”: [
- “geosite:category-ads-all”
- ],
- “enabled”: true
- },
- {
- “type”: “field”,
- “outboundTag”: “direct”,
- “domain”: [
- “geosite:cn”
- ],
- “enabled”: true
- },
- {
- “type”: “field”,
- “outboundTag”: “direct”,
- “ip”: [
- “geoip:private”,
- “geoip:cn”
- ],
- “enabled”: true
- },
- {
- “type”: “field”,
- “port”: “0-65535”,
- “outboundTag”: “proxy”,
- “enabled”: true
- }
- ]
- }
- }
复制代码
其他可以改的地方看最开头那个链接 |