[GH-ISSUE #2605] 第一次链接服务器若网络不可用,则frpc会直接退出。 #2077

Closed
opened 2026-05-05 13:20:11 -06:00 by gitea-mirror · 5 comments
Owner

Originally created by @siaimes on GitHub (Oct 6, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2605

Bug Description

我在Windows上为frpc设置了开机自启,但是经常会发现它没有自启。

经过我的反复研究,我应该是定位到了问题。

应该是frpc启动时,网络尚未链接稳定,导致frpc尝试链接服务器失败,此时frpc会直接退出而不是等待数秒重连。

如下图所示,我将网络断开之后手动运行frpc.exe也可以得到这个效果:
image

frpc Version

0.37.1

frps Version

0.37.1

System Architecture

windows/amd64

Configurations

[common]
server_addr = xxxx
server_port = 7000
privilege_token = xxxxxxxxxxxxx
tls_enable = true

[xxx]
type = tcp
local_ip = 127.0.0.1
local_port = 3389
remote_port = 7001

Logs

No response

Steps to reproduce

  1. 断开网络链接;
  2. 启动frpc;
  3. 稍等片刻,frpc自动退出。
    ...

Affected area

  • Docs
  • Installation
  • Performance and Scalability
  • Security
  • User Experience
  • Test and Release
  • Developer Infrastructure
  • Client Plugin
  • Server Plugin
  • Extensions
  • Others
Originally created by @siaimes on GitHub (Oct 6, 2021). Original GitHub issue: https://github.com/fatedier/frp/issues/2605 ### Bug Description 我在Windows上为frpc设置了开机自启,但是经常会发现它没有自启。 经过我的反复研究,我应该是定位到了问题。 应该是frpc启动时,网络尚未链接稳定,导致frpc尝试链接服务器失败,此时frpc会直接退出而不是等待数秒重连。 如下图所示,我将网络断开之后手动运行frpc.exe也可以得到这个效果: ![image](https://user-images.githubusercontent.com/34199488/136247433-43c6bce0-8c37-47f1-a26d-efef9929de20.png) ### frpc Version 0.37.1 ### frps Version 0.37.1 ### System Architecture windows/amd64 ### Configurations [common] server_addr = xxxx server_port = 7000 privilege_token = xxxxxxxxxxxxx tls_enable = true [xxx] type = tcp local_ip = 127.0.0.1 local_port = 3389 remote_port = 7001 ### Logs _No response_ ### Steps to reproduce 1. 断开网络链接; 2. 启动frpc; 3. 稍等片刻,frpc自动退出。 ... ### Affected area - [ ] Docs - [ ] Installation - [ ] Performance and Scalability - [ ] Security - [ ] User Experience - [ ] Test and Release - [ ] Developer Infrastructure - [ ] Client Plugin - [ ] Server Plugin - [ ] Extensions - [ ] Others
Author
Owner

@raisin8010 commented on GitHub (Oct 7, 2021):

同意,这对设成服务自启动的非常不方便

<!-- gh-comment-id:937420514 --> @raisin8010 commented on GitHub (Oct 7, 2021): 同意,这对设成服务自启动的非常不方便
Author
Owner

@siaimes commented on GitHub (Oct 7, 2021):

@yaott2020-666 Solved, thank you.

@fatedier 不知是文档里面没写还是我没找到,我找遍了文档都没有找到这个配置项,如果方便的话,可以找个地方贴一下,谢谢。

<!-- gh-comment-id:937827439 --> @siaimes commented on GitHub (Oct 7, 2021): @yaott2020-666 Solved, thank you. @fatedier 不知是文档里面没写还是我没找到,我找遍了文档都没有找到这个配置项,如果方便的话,可以找个地方贴一下,谢谢。
Author
Owner

@zhizunbao84 commented on GitHub (Jan 9, 2022):

怎么解决的啊?

<!-- gh-comment-id:1008234680 --> @zhizunbao84 commented on GitHub (Jan 9, 2022): 怎么解决的啊?
Author
Owner

@siaimes commented on GitHub (Jan 9, 2022):

[common]
server_addr = xxxx
server_port = 7000
privilege_token = xxxxxxxxxxxxx
tls_enable = true
login_fail_exit = false

[xxx]
type = tcp
local_ip = 127.0.0.1
local_port = 3389
remote_port = 7001
<!-- gh-comment-id:1008236583 --> @siaimes commented on GitHub (Jan 9, 2022): ``` [common] server_addr = xxxx server_port = 7000 privilege_token = xxxxxxxxxxxxx tls_enable = true login_fail_exit = false [xxx] type = tcp local_ip = 127.0.0.1 local_port = 3389 remote_port = 7001 ```
Author
Owner

@ZhangErling commented on GitHub (Oct 18, 2022):

建议将此链接或者login_fail_exit = false贴在自启动文档中,并说明改配置为frp配置,而非service文件配置,他帮助了我(CentOS 8 Steam),相信他也可以帮助更多人,感谢作者的奉献

<!-- gh-comment-id:1281767628 --> @ZhangErling commented on GitHub (Oct 18, 2022): 建议将此链接或者`login_fail_exit = false`贴在[自启动文档](https://gofrp.org/docs/setup/systemd/)中,并说明改配置为frp配置,而非service文件配置,他帮助了我(CentOS 8 Steam),相信他也可以帮助更多人,感谢作者的奉献
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#2077
No description provided.