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
25.92k stars 3.98k forks source link

在 TransportObject 中写的 grpcSettings 设置不生效 #3247

Closed mclovin-2k closed 6 months ago

mclovin-2k commented 7 months ago

TransportObject 配置

{
    "transport": {
        "wsSettings": {
            "path": "ProxyWS?ed=2560"
        },
        "httpupgradeSettings": {
            "path": "ProxyHU?ed=2560"
        },
        "grpcSettings": {
            "serviceName": "ProxyGRPC",
            "multiMode": true,
            "idle_timeout": 60,
            "permit_without_stream": true,
            "initial_windows_size": 65536
        }
    }
}

Outbounds 配置

{
    "outbounds": [
        {
            "protocol": "vless",
            "settings": {
                "vnext": [
                    {
                        "address": "xxxxx.com",
                        "port": 443,
                        "users": [
                            {
                                "id": "1234",
                                "encryption": "none"
                            }
                        ]
                    }
                ]
            },
            "streamSettings": {
                "network": "ws",
                "security": "tls",
                "tlsSettings": {
                    "fingerprint": "chrome"
                }
            }
        },
        {
            "protocol": "vless",
            "settings": {
                "vnext": [
                    {
                        "address": "xxxxx.com",
                        "port": 443,
                        "users": [
                            {
                                "id": "1234",
                                "encryption": "none"
                            }
                        ]
                    }
                ]
            },
            "streamSettings": {
                "network": "httpupgrade",
                "security": "tls",
                "tlsSettings": {
                    "fingerprint": "chrome"
                }
            }
        },
        {
            "protocol": "vless",
            "settings": {
                "vnext": [
                    {
                        "address": "xxxxx.com",
                        "port": 443,
                        "users": [
                            {
                                "id": "1234",
                                "encryption": "none"
                            }
                        ]
                    }
                ]
            },
            "streamSettings": {
                "network": "grpc",
                "security": "tls",
                "tlsSettings": {
                    "fingerprint": "chrome"
                }
            }
        }
    ]
}

3个出站,ws 和 httpupgrade 都正常,就是 GRPC 连不上。 从服务端的日志看,是 TransportObject 中写的 grpcSettings 设置没生效,serviceName 是空。 必须把 grpcSettings 里的内容放到出站的 streamSettings 里才可以。

忘了说了Server和Client都是 1.8.10。

Fangliding commented 7 months ago

古代问题 那个所谓的全局配置早该移除了 现在不推荐这么配置 推荐都写在streamsettings里

mclovin-2k commented 7 months ago

古代问题 那个所谓的全局配置早该移除了 现在不推荐这么配置 推荐都写在streamsettings里

我觉得 TransportObject 还挺方便的啊 节点多的话可以省很多复制粘贴啊 如果真要取消全局配置,请给用户设计一个灵活的多配置文件机制,类似于V2FLY V5那种的也行。

RPRX commented 7 months ago

@Fangliding 可以把这个上古配置方式给删了 文档也需要删 还有文档都没写的上古配置可以直接把相关代码删了

不知不觉 https://github.com/XTLS/Xray-core/discussions/1967 快一年了

mclovin-2k commented 7 months ago

@Fangliding 可以把这个上古配置方式给删了 文档也需要删 还有文档都没写的上古配置可以直接把相关代码删了

~不知不觉 #1967 快一年了~

TransportObject 全局配置只是一种简化重复配置的方法,并不是什么过时的协议。这也不能保留吗?

chika0801 commented 7 months ago

https://xtls.github.io/Xray-docs-next/config/transport.html

楼主不提还真没注意到,有这种上古的 全局配置([TransportObject](https://xtls.github.io/Xray-docs-next/config/transport.html#transportobject)) 这写法

一直习惯写 局部配置([StreamSettingsObject](https://xtls.github.io/Xray-docs-next/config/transport.html#streamsettingsobject))

Fangliding commented 6 months ago

在文档里折叠掉了 不过为了提个醒(code里还没删掉 当然删掉了指不定就出事了)就没完全移除 毕竟不想有什么代码里有文档里没有的幽灵功能()