mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 16:15:49 -06:00
[GH-ISSUE #256] During startup, can frpc retry if error on server connection? #182
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#182
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yydcool on GitHub (Feb 17, 2017).
Original GitHub issue: https://github.com/fatedier/frp/issues/256
The case happens when I start frps later than frpc.
frpc will try to connect server, but the frps is not running yet. So frpc print "connect to server failed!" then exit.
Refer to code in frpc/control.go func ControlProcess(cli *client.ProxyClient, wait *sync.WaitGroup)
Would it be better to have a while loop here? always retry until connected to server (also wait (e.g. 10s) between each retry)
@cxx8294 commented on GitHub (Feb 17, 2017):
请讲普通话
@fatedier commented on GitHub (Feb 17, 2017):
@yydcool Users may set wrong server ip or port, and it will never connect success. So i think it's better to feedback the error and exit.
@fatedier commented on GitHub (Feb 17, 2017):
@cxx8294 Github 上推荐用英语,方便各个国家的使用者共同交流,只要别人能看懂就行了。
@soldierssword commented on GitHub (Feb 27, 2018):
但是有时候需要重启公网的frps来重新加载配置文件,如果不自动重连的话那就很麻烦了,希望在启动参数中加入失败重试。
@baixiaoshengofficial commented on GitHub (Oct 23, 2018):
建议新加参数,让用户承担后果吧~
当前的情况是,FRPS似乎因为内存的问题导致服务器崩了,重启了服务器之后,人不在FRPC的环境没办法远程遥控FRPC重启,就造成了一个连不上FRPS的死局···
@fantasydr commented on GitHub (Mar 11, 2019):
If you're using systemd to launch frps, add something like this in the systemd conf file:
A hint for someone like me newly to the frps and systemd.
@HomeLH commented on GitHub (Mar 20, 2019):
A configurable retry entry is helpful for embedding devices, because their network service such as 4G may not be stable.
@HomeLH commented on GitHub (Mar 20, 2019):
Thanks a lot. This method works well. It will retry every "RestartSec“.
@Marcocxy commented on GitHub (Aug 23, 2022):
Any idea for frpc(frp client)? The topic was frpc not frps.
@axmmisaka commented on GitHub (Dec 31, 2022):
You could, if you want, write a wrapper script in powershell like this
or a comparable script in bash to make it keep trying.
That said I ran into similar problems and it might be a good feature to add, although it certainly could be solved externally; I'm using nssm on windows and the restart logic is such a pita
如果你想的话,可以写个上面贴的这种执行脚本或者bash中类似的脚本让程序失败后重试
不过我最近遇到了类似的问题,虽然这个问题可以用外部工具解决,我觉得可能也是个可以加入的好特性;我在windows上用nssm,重启逻辑是真的高血压