[GH-ISSUE #4423] wss 协议 connect to server error: unexpected EOF #3493

Closed
opened 2026-05-05 14:14:39 -06:00 by gitea-mirror · 3 comments
Owner

Originally created by @xqzr on GitHub (Sep 6, 2024).
Original GitHub issue: https://github.com/fatedier/frp/issues/4423

Bug Description

frpc 使用 wss 协议,连接 frps 出现 unexpected EOF 错误,随后退出。

frpc Version

0.60.0

frps Version

0.60.0

System Architecture

frps: linux/amd64;frpc: windows/amd64

Configurations

frps

{
    "bindPort": 27100,
    "quicBindPort": 27100,
    "auth": {
        "token": "xqzr"
    },
    "transport": {
        "tls": {
            "force": true,
            "certFile": "/usr/local/share/ssl/wo25.net_ecc/fullchain.cer",
            "keyFile": "/usr/local/share/ssl/wo25.net_ecc/wo25.net.key"
        }
    },
    "vhostHTTPPort": 32080,
    "vhostHTTPSPort": 32443,
    "webServer": {
        "addr": "::1",
        "port": 7501,
        "user": "****",
        "password": "****"
    },
    "allowPorts": [
        {
            "start": 32000,
            "end": 32499
        }
    ],
    "subDomainHost": "frp.wo25.net",
    "httpPlugins": [
        {
            "addr": "[::1]:7502",
            "ops": [
                "NewProxy",
                "NewUserConn"
            ]
        }
    ]
}

frpc
见下文。

Logs

frpc tcp -p <协议> -s frp.wo25.net -P 27100 -t xqzr -n 0

<协议> 使用 tcpwebsocketquic 都能获得,以下类似的输出

2024-09-06 16:36:44.374 [I] [client/service.go:295] try to connect to server...
2024-09-06 16:36:44.562 [I] [client/service.go:287] [c45a5f57694bda14] login to server success, get run id [c45a5f57694bda14]
2024-09-06 16:36:44.564 [I] [proxy/proxy_manager.go:173] [c45a5f57694bda14] proxy added: [0]

<协议> 使用 wss 获得以下错误输出

2024-09-06 16:37:11.437 [I] [client/service.go:295] try to connect to server...
2024-09-06 16:37:11.617 [W] [client/service.go:298] connect to server error: unexpected EOF
login to the server failed: unexpected EOF. With loginFailExit enabled, no additional retries will be attempted

Steps to reproduce

  1. 配置 frps
  2. frpc tcp -p wss -s frp.wo25.net -P 27100 -t xqzr -n 0

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @xqzr on GitHub (Sep 6, 2024). Original GitHub issue: https://github.com/fatedier/frp/issues/4423 ### Bug Description frpc 使用 wss 协议,连接 frps 出现 `unexpected EOF` 错误,随后退出。 ### frpc Version 0.60.0 ### frps Version 0.60.0 ### System Architecture frps: linux/amd64;frpc: windows/amd64 ### Configurations frps ```json { "bindPort": 27100, "quicBindPort": 27100, "auth": { "token": "xqzr" }, "transport": { "tls": { "force": true, "certFile": "/usr/local/share/ssl/wo25.net_ecc/fullchain.cer", "keyFile": "/usr/local/share/ssl/wo25.net_ecc/wo25.net.key" } }, "vhostHTTPPort": 32080, "vhostHTTPSPort": 32443, "webServer": { "addr": "::1", "port": 7501, "user": "****", "password": "****" }, "allowPorts": [ { "start": 32000, "end": 32499 } ], "subDomainHost": "frp.wo25.net", "httpPlugins": [ { "addr": "[::1]:7502", "ops": [ "NewProxy", "NewUserConn" ] } ] } ``` frpc 见下文。 ### Logs ```batch frpc tcp -p <协议> -s frp.wo25.net -P 27100 -t xqzr -n 0 ``` `<协议>` 使用 `tcp`、`websocket` 、`quic` 都能获得,以下类似的输出 ```log 2024-09-06 16:36:44.374 [I] [client/service.go:295] try to connect to server... 2024-09-06 16:36:44.562 [I] [client/service.go:287] [c45a5f57694bda14] login to server success, get run id [c45a5f57694bda14] 2024-09-06 16:36:44.564 [I] [proxy/proxy_manager.go:173] [c45a5f57694bda14] proxy added: [0] ``` `<协议>` 使用 `wss` 获得以下错误输出 ```log 2024-09-06 16:37:11.437 [I] [client/service.go:295] try to connect to server... 2024-09-06 16:37:11.617 [W] [client/service.go:298] connect to server error: unexpected EOF login to the server failed: unexpected EOF. With loginFailExit enabled, no additional retries will be attempted ``` ### Steps to reproduce 1. 配置 frps 2. `frpc tcp -p wss -s frp.wo25.net -P 27100 -t xqzr -n 0` ### Affected area - [ ] Docs - [ ] Installation - [X] Performance and Scalability - [ ] Security - [X] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [X] Extensions - [ ] Others
Author
Owner

@fatedier commented on GitHub (Sep 6, 2024):

这就是为什么之前一直不希望支持 wss 的原因,预期中就肯定会一直有人提出这样的问题。 https://github.com/fatedier/frp/issues/3519#issuecomment-1630052761

<!-- gh-comment-id:2333585057 --> @fatedier commented on GitHub (Sep 6, 2024): 这就是为什么之前一直不希望支持 wss 的原因,预期中就肯定会一直有人提出这样的问题。 https://github.com/fatedier/frp/issues/3519#issuecomment-1630052761
Author
Owner

@xqzr commented on GitHub (Sep 6, 2024):

这就是为什么之前一直不希望支持 wss 的原因,预期中就肯定会一直有人提出这样的问题。 #3519 (comment)

希望能够明确 unexpected EOF 具体的错误(这让人很困惑)。

<!-- gh-comment-id:2333625085 --> @xqzr commented on GitHub (Sep 6, 2024): > 这就是为什么之前一直不希望支持 wss 的原因,预期中就肯定会一直有人提出这样的问题。 [#3519 (comment)](https://github.com/fatedier/frp/issues/3519#issuecomment-1630052761) 希望能够明确 `unexpected EOF` 具体的错误(这让人很困惑)。
Author
Owner

@fatedier commented on GitHub (Sep 6, 2024):

有困惑是正常的,这个设计就不合理,不应该在这个层面上支持这个能力。EOF 就是断开连接了,只是这里是协议不匹配造成的,也可能是因为其他原因造成的,无法得知具体的原因。

<!-- gh-comment-id:2333641913 --> @fatedier commented on GitHub (Sep 6, 2024): 有困惑是正常的,这个设计就不合理,不应该在这个层面上支持这个能力。EOF 就是断开连接了,只是这里是协议不匹配造成的,也可能是因为其他原因造成的,无法得知具体的原因。
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/frp#3493
No description provided.