Skip to content
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

quic 是否不相容 dialerProxy? #2605

Closed
kingwilliam opened this issue Oct 2, 2023 · 0 comments
Closed

quic 是否不相容 dialerProxy? #2605

kingwilliam opened this issue Oct 2, 2023 · 0 comments

Comments

@kingwilliam
Copy link

kingwilliam commented Oct 2, 2023

start service 正常
但一有data经过 outbound:out-quic-proxy, xray就会error

outbound
        // out-quic-proxy
        {
            "tag": "out-quic-proxy",
            "protocol": "vless",
            "settings": {
                "vnext": [
                    {
                        "address": "{address2}",
                        "port": 553,
                        "users": [
                            {
                                "id": "{id}",
                                "encryption": "none"
                            }
                        ]
                    }
                ]
            },
            "streamSettings": {
                "network": "quic",
                "quicSettings": {
                    "security": "chacha20-poly1305",
                    "key": "{key}"
                },
                "Sockopt": {
                    "dialerProxy": "out-proxy",
                    "mark": 7
                }
            }


        // out-proxy
        {
            "tag": "out-proxy",
            "protocol": "vless",
            "settings": {
                "vnext": [
                    {
                        "address": "{address}",
                        "port": 443,
                        "users": [
                            {
                                "id": "{id}",
                                "flow": "xtls-rprx-vision",
                                "encryption": "none"
                            }
                        ]
                    }
                ]
            },
            "streamSettings": {
                "network": "tcp",
                "security": "reality",
                "realitySettings": {
                    "show": false,
                    "fingerprint": "chrome",
                    "serverName": "{serverName}",
                    "publicKey": "{publicKey}",
                    "shortId": "{shortId}",
                    "spiderX": "/"
                },
                "sockopt": {
                    "mark": 255
                }
            }
        },
xray error.log
2023/10/01 21:15:09 [Warning] core: Xray 1.8.4 started
2023/10/01 21:15:10 [Debug] [3947016068] proxy/dokodemo: processing connection from: 192.168.1.250:37621
2023/10/01 21:15:10 [Info] [3947016068] proxy/dokodemo: received request for 192.168.1.250:37621
2023/10/01 21:15:11 [Info] [3947016068] app/dispatcher: taking detour [out-quic-proxy] for [tcp:8.8.8.8:53]
只有这麽多

syslog
Oct  1 21:15:09 v2-ext systemd[1]: Started Xray Service.
Oct  1 21:15:09 v2-ext xray[12840]: Xray 1.8.4 (Xray, Penetrates Everything.) Custom (go1.21.0 linux/amd64)
Oct  1 21:15:09 v2-ext xray[12840]: A unified platform for anti-censorship.
Oct  1 21:15:09 v2-ext xray[12840]: 2023/10/01 21:15:09 Using confdir from arg: /usr/local/etc/xray/confdir
Oct  1 21:15:09 v2-ext xray[12840]: 2023/10/01 21:15:09 [Info] infra/conf/serial: Reading config: /usr/local/etc/xray/confdir/0-config.json
Oct  1 21:15:09 v2-ext xray[12840]: 2023/10/01 21:15:09 [Info] infra/conf/serial: Reading config: /usr/local/etc/xray/confdir/1-inbounds.json
Oct  1 21:15:09 v2-ext xray[12840]: 2023/10/01 21:15:09 [Info] infra/conf/serial: Reading config: /usr/local/etc/xray/confdir/2-routing.json
Oct  1 21:15:09 v2-ext xray[12840]: 2023/10/01 21:15:09 [Info] infra/conf/serial: Reading config: /usr/local/etc/xray/confdir/3-outbounds.json
Oct  1 21:15:11 v2-ext xray[12840]: panic: interface conversion: net.Conn is *cnc.connection, not *internet.PacketConnWrapper
Oct  1 21:15:11 v2-ext xray[12840]: goroutine 18 [running]:
Oct  1 21:15:11 v2-ext xray[12840]: github.com/xtls/xray-core/transport/internet/quic.(*clientConnections).openConnection(0x1bb84f0, {0x1346f20, 0xc000284810}, {0x133e640, 0xc0002852c0}, 0x0?, 0x0?, 0x0?)
Oct  1 21:15:11 v2-ext xray[12840]: #011github.com/xtls/xray-core/transport/internet/quic/dialer.go:151 +0xc13
Oct  1 21:15:11 v2-ext xray[12840]: github.com/xtls/xray-core/transport/internet/quic.Dial({0x1346f20, 0xc000284810}, {{0x1346d60?, 0xc00024ff40?}, 0x0?, 0x0?}, 0xc000279a40)
Oct  1 21:15:11 v2-ext xray[12840]: #011github.com/xtls/xray-core/transport/internet/quic/dialer.go:212 +0x1c5
Oct  1 21:15:11 v2-ext xray[12840]: github.com/xtls/xray-core/transport/internet.Dial({0x1346f20, 0xc000284810}, {{0x1346d60?, 0xc00024ff40?}, 0xff40?, 0xc0?}, 0x0?)
Oct  1 21:15:11 v2-ext xray[12840]: #011github.com/xtls/xray-core/transport/internet/dialer.go:57 +0x1d0
Oct  1 21:15:11 v2-ext xray[12840]: github.com/xtls/xray-core/app/proxyman/outbound.(*Handler).Dial(0xc00026cf80, {0x1346f20?, 0xc000284810?}, {{0x1346d60, 0xc00024ff40}, 0x5a5, 0x2})
Oct  1 21:15:11 v2-ext xray[12840]: #011github.com/xtls/xray-core/app/proxyman/outbound/handler.go:276 +0xb0b
Oct  1 21:15:11 v2-ext xray[12840]: github.com/xtls/xray-core/proxy/vless/outbound.(*Handler).Process.func1()
Oct  1 21:15:11 v2-ext xray[12840]: #011github.com/xtls/xray-core/proxy/vless/outbound/outbound.go:80 +0xa6
Oct  1 21:15:11 v2-ext xray[12840]: github.com/xtls/xray-core/common/retry.(*retryer).On(0xc0002cbae0, 0xc0002cbb48)
Oct  1 21:15:11 v2-ext xray[12840]: #011github.com/xtls/xray-core/common/retry/retry.go:27 +0xc6
Oct  1 21:15:11 v2-ext xray[12840]: github.com/xtls/xray-core/proxy/vless/outbound.(*Handler).Process(0xc000284660, {0x1346f20, 0xc000284810}, 0xc00026e120, {0x133e668, 0xc00026cf80})
Oct  1 21:15:11 v2-ext xray[12840]: #011github.com/xtls/xray-core/proxy/vless/outbound/outbound.go:77 +0x1e5
Oct  1 21:15:11 v2-ext xray[12840]: github.com/xtls/xray-core/app/proxyman/outbound.(*Handler).Dispatch(0xc00026cf80, {0x1346f20, 0xc000284810}, 0xc00026e120)
Oct  1 21:15:11 v2-ext xray[12840]: #011github.com/xtls/xray-core/app/proxyman/outbound/handler.go:206 +0x3f8
Oct  1 21:15:11 v2-ext xray[12840]: github.com/xtls/xray-core/app/dispatcher.(*DefaultDispatcher).routedDispatch(0xc000264f00, {0x1346f20, 0xc000284810}, 0xc00026e120, {{0x1347070, 0xc00029c010}, 0x35, 0x2})
Oct  1 21:15:11 v2-ext xray[12840]: #011github.com/xtls/xray-core/app/dispatcher/default.go:439 +0xbc2
Oct  1 21:15:11 v2-ext xray[12840]: github.com/xtls/xray-core/app/dispatcher.(*DefaultDispatcher).Dispatch.func1()
Oct  1 21:15:11 v2-ext xray[12840]: #011github.com/xtls/xray-core/app/dispatcher/default.go:263 +0x5fd
Oct  1 21:15:11 v2-ext xray[12840]: created by github.com/xtls/xray-core/app/dispatcher.(*DefaultDispatcher).Dispatch in goroutine 17
Oct  1 21:15:11 v2-ext xray[12840]: #011github.com/xtls/xray-core/app/dispatcher/default.go:236 +0x39f
Oct  1 21:15:11 v2-ext systemd[1]: xray.service: Main process exited, code=exited, status=2/INVALIDARGUMENT
Oct  1 21:15:11 v2-ext systemd[1]: xray.service: Failed with result 'exit-code'.
Oct  1 21:15:11 v2-ext systemd[1]: xray.service: Scheduled restart job, restart counter is at 4.
Oct  1 21:15:11 v2-ext systemd[1]: Stopped Xray Service.
Oct  1 21:15:11 v2-ext systemd[1]: xray.service: Start request repeated too quickly.
Oct  1 21:15:11 v2-ext systemd[1]: xray.service: Failed with result 'exit-code'.
Oct  1 21:15:11 v2-ext systemd[1]: Failed to start Xray Service.

cty123 added a commit to cty123/Xray-core that referenced this issue Nov 13, 2023
Issue XTLS#2605 brought up real problem that QUIC dialer doesn't support sockopt at the moment. Inside `internet.DialSystem(...)` function, one of the branch that involves `redirect(...)` returns `cnc.connection` instance that is currently unhandled by the code logic, and thus caused program panic during runtime.

It seems the sockopt support for QUIC protocol requires a couple changes including making `cnc.connection` public, such that we can handle in dialer, along with some thorough tests, this commit simply adds safety check to explicity state the fact that QUIC isn't working with sockopt. And the implementation of the feature can be scheduled later on.
yuhan6665 pushed a commit that referenced this issue Nov 14, 2023
Issue #2605 brought up real problem that QUIC dialer doesn't support sockopt at the moment. Inside `internet.DialSystem(...)` function, one of the branch that involves `redirect(...)` returns `cnc.connection` instance that is currently unhandled by the code logic, and thus caused program panic during runtime.

It seems the sockopt support for QUIC protocol requires a couple changes including making `cnc.connection` public, such that we can handle in dialer, along with some thorough tests, this commit simply adds safety check to explicity state the fact that QUIC isn't working with sockopt. And the implementation of the feature can be scheduled later on.
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

No branches or pull requests

2 participants