[GH-ISSUE #3002] 【使用问题】关于ws可用,wss自动断开的问题 #2398

Closed
opened 2026-05-05 13:32:41 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @anycodes on GitHub (Jul 4, 2022).
Original GitHub issue: https://github.com/fatedier/frp/issues/3002

Bug Description

我现在的流程是:

客户端->云服务器(frp server)-> 客户端(frp client)-> django项目

我遇到的问题是,
http请求,https请求,ws请求,都是可以用的,没有问题,但是wss请求就会有问题,具体表现是客户端提示连接成功,然后迅速断开连接,服务端也是被断开,然后提示的code是1006,整个链路看了好久没发现啥问题,觉得可能是frp这里配置的问题或者其他问题,想请各位大佬帮忙指导一下。

frpc Version

frp_0.42.0

frps Version

frp_0.42.0

System Architecture

linux_amd64

Configurations

服务端的配置就是

[common]
bind_addr = 0.0.0.0
bind_port = 7000


vhost_http_port = 80
vhost_https_port = 443

客户端的配置:

[common]
server_addr = 119.45.71.xxx
server_port = 7xxx

[web02]
type = http
local_ip = 192.168.50.x
local_port = 8000
custom_domains = api.xxxxxxx.cn

[web03]
type = https
local_ip = 192.168.50.x
local_port = 8000
custom_domains = api.xxxxxxx.cn
plugin = https2http
use_encryption = false
use_compression = true
remote_port = 443
# https证书配置
plugin_crt_path = ./ssl/xxxxxxx
plugin_key_path = ./ssl/xxxxxxx
plugin_local_addr = 192.168.50.x:8000
plugin_header_X-From-Where = ftrp
plugin_host_header_rewrite = api.xxxxxxx.cn

Logs

No response

Steps to reproduce

...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @anycodes on GitHub (Jul 4, 2022). Original GitHub issue: https://github.com/fatedier/frp/issues/3002 ### Bug Description 我现在的流程是: ``` 客户端->云服务器(frp server)-> 客户端(frp client)-> django项目 ``` 我遇到的问题是, http请求,https请求,ws请求,都是可以用的,没有问题,但是wss请求就会有问题,具体表现是客户端提示连接成功,然后迅速断开连接,服务端也是被断开,然后提示的code是1006,整个链路看了好久没发现啥问题,觉得可能是frp这里配置的问题或者其他问题,想请各位大佬帮忙指导一下。 ### frpc Version frp_0.42.0 ### frps Version frp_0.42.0 ### System Architecture linux_amd64 ### Configurations 服务端的配置就是 ``` [common] bind_addr = 0.0.0.0 bind_port = 7000 vhost_http_port = 80 vhost_https_port = 443 ``` 客户端的配置: ``` [common] server_addr = 119.45.71.xxx server_port = 7xxx [web02] type = http local_ip = 192.168.50.x local_port = 8000 custom_domains = api.xxxxxxx.cn [web03] type = https local_ip = 192.168.50.x local_port = 8000 custom_domains = api.xxxxxxx.cn plugin = https2http use_encryption = false use_compression = true remote_port = 443 # https证书配置 plugin_crt_path = ./ssl/xxxxxxx plugin_key_path = ./ssl/xxxxxxx plugin_local_addr = 192.168.50.x:8000 plugin_header_X-From-Where = ftrp plugin_host_header_rewrite = api.xxxxxxx.cn ``` ### Logs _No response_ ### Steps to reproduce 1. 2. 3. ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [X] Developer Infrastructure - [X] Client Plugin - [X] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@anycodes commented on GitHub (Jul 4, 2022):

因为我对这个不是很熟悉,也是盲猜是这部分的问题。

我刚才在frp client后面加了一个nginx,问题得以解决,我先close这个issue。

<!-- gh-comment-id:1173844748 --> @anycodes commented on GitHub (Jul 4, 2022): 因为我对这个不是很熟悉,也是盲猜是这部分的问题。 我刚才在frp client后面加了一个nginx,问题得以解决,我先close这个issue。
Author
Owner

@rxluck commented on GitHub (Jan 3, 2023):

我遇到了相同的问题,请问能够提供nginx一下frpc client的nginx配置吗?

<!-- gh-comment-id:1369443468 --> @rxluck commented on GitHub (Jan 3, 2023): 我遇到了相同的问题,请问能够提供nginx一下frpc client的nginx配置吗?
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#2398
No description provided.