XTLS / Xray-core

Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.
https://t.me/projectXray
Mozilla Public License 2.0
22.84k stars 3.66k forks source link

x-ui面板回落失效 #1092

Closed sangyufeiwanya closed 2 months ago

sangyufeiwanya commented 2 years ago

443入栈: { "listen": null, "port": 443, "protocol": "vless", "settings": { "clients": [ { "id": "xxxx", "flow": "xtls-rprx-direct" } ], "decryption": "none", "fallbacks": [ { "name": "", "alpn": "", "path": "", "dest": "80", "xver": 1 }, { "name": "", "alpn": "", "path": "/test", "dest": "26299", "xver": 1 } ] }, "streamSettings": { "network": "ws", "security": "tls", "tlsSettings": { "serverName": "xxxx", "certificates": [ { "certificateFile": "/etc/v2ray/v2ray.crt", "keyFile": "/etc/v2ray/v2ray.key" } ] }, "wsSettings": { "path": "/sangyufeiwan", "headers": {} } }, "tag": "inbound-443", "sniffing": { "enabled": true, "destOverride": [ "http", "tls" ] } } 回落后的入站: { "listen": "127.0.0.1", "port": 26299, "protocol": "vmess", "settings": { "clients": [ { "id": "xxxx", "alterId": 0 } ], "disableInsecureEncryption": false }, "streamSettings": { "network": "ws", "security": "tls", "tlsSettings": { "serverName": "xxxx.xxx", "certificates": [ { "certificateFile": "/etc/v2ray/v2ray.crt", "keyFile": "/etc/v2ray/v2ray.key" } ] }, "wsSettings": { "path": "/test", "headers": {} } }, "tag": "inbound-26299", "sniffing": { "enabled": true, "destOverride": [ "http", "tls" ] } } 回落好像并没有工作。

服务端日志: 2022/07/20 09:08:23 [Info] [4229448899] proxy/vless/inbound: firstLen = 185 2022/07/20 09:08:23 [Info] [4229448899] proxy/vless/inbound: fallback starts > proxy/vless/encoding: invalid request version 2022/07/20 09:08:23 [Info] [4229448899] proxy/vless/inbound: realName = haoduck.cf 2022/07/20 09:08:23 [Info] [4229448899] proxy/vless/inbound: realAlpn = http/1.1 2022/07/20 09:08:23 [Info] [4229448899] proxy/vless/inbound: realPath = /test 2022/07/20 09:08:24 [Info] [4229448899] app/proxyman/inbound: connection ends > proxy/vless/inbound: fallback ends > context canceled

skydevil88 commented 2 years ago

相同问题,修改config.json重启x-ui就会被还原。

sangyufeiwanya commented 2 years ago

相同的问题,修改.json重新启动x-uiconfig一直被还原。 被还原很正常,但是通过面板配置后还是不能使用

wpyok500 commented 1 year ago

如果搭配了nginx ,回落设置alpn 设定成 h2

sangyufeiwanya commented 1 year ago

如果用了nginx,回落设置alpn 设置成h2

我照你说的做了但是还是没有效果

wpyok500 commented 1 year ago

nginx的配置文件也要开启http2代理监听,还有x-ui的回落配置设置参数不全,不能使用http/1.1的回落配置方案,如果要用需改xui的配置数据库

sangyufeiwanya commented 1 year ago

nginx的配置文件远程开启http2代理监听,x-ui的回传设置参数不全,不能使用http/1.1的回落配置数据库,如果还有需要修改xui的配置

我没有使用 nginx,一样的情况

wpyok500 commented 1 year ago

我是搭配nginx做回落, image image

nginx 配置 listen 8080 http2 proxy_protocol;

server
{
        listen 80 default_server;
        listen [::]:80 default_server;
        server_name _;
        return 301 https://$http_host$request_uri;

        access_log  /dev/null;
        error_log  /dev/null;
}
server
{
    ##需要更改的地方:x-ui面板设定(43、44行)

    listen 8080 http2 proxy_protocol;

    #配置站点域名,多个以空格分开
    server_name _;
    index index.php index.html index.htm default.php default.htm default.html;
    root /www/xray_web;

    add_header Strict-Transport-Security "max-age=63072000" always;

    #禁止访问的文件或目录
    location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
    {
        return 404;
    }

    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
        expires      30d;
        error_log /dev/null;
        access_log /dev/null;
    }

    location ~ .*\.(js|css)?$
    {
        expires      12h;
        error_log /dev/null;
        access_log /dev/null; 
    }
    location ^~ /myxui {
    proxy_pass http://127.0.0.1:54321/myxui;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}   
sangyufeiwanya commented 1 year ago

我在能正常回落的xray配置中加入我的fallback数组,我自己的回落依旧不能生效但是之前的回落还是能够正常工作,我甚至不能在access.log看到连接记录。 443入站: { "inbounds":[ { "port": 443, "protocol": "vless", "tag":"VLESSTCP", "settings": { "clients": [ { "id": "xxxx", "add":"xxxx.om", "flow":"xtls-rprx-direct", "email": "haoduck.cf_VLESS_XTLS/TLS-direct_TCP" } ], "decryption": "none", "fallbacks": [ {"dest":31296,"xver":1}, {"alpn":"h2","dest":31302,"xver":0}, {"path":"/dctkws","dest":31297,"xver":1}, {"path":"/dctkvws","dest":31299,"xver":1} //这一行是我自己添加的回落配置,上面的回落能够正常工作 ] }, "streamSettings": { "network": "tcp", "security": "xtls", "xtlsSettings": { "minVersion": "1.2", "alpn": [ "http/1.1", "h2" ], "certificates": [ { "certificateFile": "/etc/v2ray-agent/tls/haoduck.cf.crt", "keyFile": "/etc/v2ray-agent/tls/haoduck.cf.key", "ocspStapling": 3600, "usage":"encipherment" } ] } } } ] } 回落后端入站: { "listen": "127.0.0.1", "port": 24917, "protocol": "vmess", "settings": { "clients": [ { "id": "xxxx", "alterId": 0 } ], "disableInsecureEncryption": false }, "streamSettings": { "network": "ws", "security": "tls", "tlsSettings": { "serverName": "xxxx.com", "certificates": [ { "certificateFile": "/etc/v2ray/v2ray.crt", "keyFile": "/etc/v2ray/v2ray.key" } ] }, "wsSettings": { "path": "/test", "headers": {} } }, "tag": "inbound-24917", "sniffing": { "enabled": true, "destOverride": [ "http", "tls" ] } } ]