Skip to content

Commands: Fix dumping merged config for XHTTP #4290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 17, 2025
Merged

Commands: Fix dumping merged config for XHTTP #4290

merged 3 commits into from
Jan 17, 2025

Conversation

vrnobody
Copy link
Contributor

No description provided.

@Fangliding Fangliding linked an issue Jan 15, 2025 that may be closed by this pull request
4 tasks
"acceptProxyProtocol": false,
"tcpcongestion": "bbr",
"tcpMptcp": true,
"tcpNoDelay": true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个没了

@vrnobody
Copy link
Contributor Author

5f3b11e 和下面的讨论无关,那个 commit 只是把字符串 "0" 输出为数字 0 好看一点。

outbounds[0].streamSettings 下面有 sockopt 啊,这是把单元测试里面的配置 dump 出来的输出内容:

{
    "api": {
        "services": [
            "HandlerService",
            "StatsService"
        ],
        "tag": "api"
    },
    "inbounds": [
        {
            "listen": "127.0.0.1",
            "port": 18080,
            "protocol": "http",
            "settings": {},
            "tag": "agentin"
        },
        {
            "listen": "127.0.0.1",
            "port": 10085,
            "protocol": "dokodemo-door",
            "settings": {
                "address": "127.0.0.1"
            },
            "tag": "api-in"
        }
    ],
    "log": {
        "dnsLog": false,
        "loglevel": "debug"
    },
    "outbounds": [
        {
            "protocol": "vless",
            "settings": {
                "vnext": [
                    {
                        "address": "1.2.3.4",
                        "port": 1234,
                        "users": [
                            {
                                "id": "4784f9b8-a879-4fec-9718-ebddefa47750",
                                "encryption": "none"
                            }
                        ]
                    }
                ]
            },
            "streamSettings": {
                "network": "xhttp",
                "port": 0,
                "sockopt": {
                    "acceptProxyProtocol": false,
                    "mark": 0,
                    "penetrate": false,
                    "tcpCongestion": "bbr",
                    "tcpFastOpen": true,
                    "tcpKeepAliveIdle": 0,
                    "tcpKeepAliveInterval": 0,
                    "tcpMaxSeg": 0,
                    "tcpMptcp": true,
                    "tcpUserTimeout": 0,
                    "tcpWindowClamp": 0,
                    "v6only": false
                },
                "xhttpSettings": {
                    "extra": {
                        "noSSEHeader": false,
                        "scMaxEachPostBytes": 1000000,
                        "scMaxBufferedPosts": 30,
                        "xPaddingBytes": "100-1000"
                    },
                    "host": "bing.com",
                    "mode": "auto",
                    "noGRPCHeader": false,
                    "noSSEHeader": false,
                    "path": "/xhttp_client_upload",
                    "scMaxBufferedPosts": 0,
                    "scMaxEachPostBytes": 0,
                    "scMinPostsIntervalMs": 0,
                    "xPaddingBytes": 0,
                    "xmux": {
                        "cMaxReuseTimes": 0,
                        "hKeepAlivePeriod": 0,
                        "hMaxRequestTimes": 0,
                        "hMaxReusableSecs": 0,
                        "maxConcurrency": 0,
                        "maxConnections": 0
                    }
                }
            },
            "tag": "XHTTP_IN"
        }
    ],
    "policy": {
        "levels": {
            "0": {
                "statsUserDownlink": true,
                "statsUserOnline": false,
                "statsUserUplink": true
            }
        },
        "system": {
            "statsInboundDownlink": true,
            "statsInboundUplink": true,
            "statsOutboundDownlink": true,
            "statsOutboundUplink": true
        }
    },
    "routing": {
        "domainStrategy": "AsIs",
        "rules": [
            {
                "inboundTag": [
                    "api-in"
                ],
                "outboundTag": "api",
                "type": "field"
            }
        ]
    },
    "stats": {}
}

如果你指的是单元测试里面的输出,那个已经 build() 成 TypedMessage 分散到 socketSettings 和 transportSettings 里面了。

@RPRX
Copy link
Member

RPRX commented Jan 16, 2025

我是说 tcpNoDelay 这个选项被删了,我等会儿看看,我可能直接改一下这个 PR

@vrnobody
Copy link
Contributor Author

哦,那就是当时删这个功能的时候配置项没删干净了。好吧,你改下吧。

TFO interface{} `json:"tcpFastOpen"`

@RPRX
Copy link
Member

RPRX commented Jan 16, 2025

你在说啥,我说的是 tcpNoDelay,你改吧

@vrnobody
Copy link
Contributor Author

看错了。已删。

@RPRX RPRX changed the title fix issue #4287 Commands: Fix dumping merged config for XHTTP Jan 17, 2025
@RPRX RPRX merged commit 66dd780 into XTLS:main Jan 17, 2025
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Config dump seems to not support xhttpSettings field yet, causing panic.
3 participants