[GH-ISSUE #2443] 客户端新增一个线程监听配置文件,当配置文件发生变化时重启客户端服务 #1942

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

Originally created by @breeze12x on GitHub (Jun 8, 2021).
Original GitHub issue: https://github.com/fatedier/frp/issues/2443

The solution you want

客户端新增一个线程监听配置文件,当配置文件发生变化时重启客户端服务

Alternatives considered

客户端启动后只提供连接鉴权等信息,所有的链接信息都在服务器上配置(这个工作量太大了。。。),然后实现热更新

How to implement this function

1.获得客户端启动的配置文件
2.用一个线程去监听这个文件
3.当文件发生变化时,校验配置是否正确,如果正确重启服务

Application scenarios of this function

现在想要修改映射连接需要修改配置文件,并且杀掉进程再重新启动。如果主动监听配置文件变化然后重启服务则可以减少重复操作

Originally created by @breeze12x on GitHub (Jun 8, 2021). Original GitHub issue: https://github.com/fatedier/frp/issues/2443 <!-- From Chinese to English by machine translation, welcome to revise and polish. --> **The solution you want** <!--A clear and concise description of the solution you want. --> 客户端新增一个线程监听配置文件,当配置文件发生变化时重启客户端服务 **Alternatives considered** <!--A clear and concise description of any alternative solutions or features you have considered. --> 客户端启动后只提供连接鉴权等信息,所有的链接信息都在服务器上配置(这个工作量太大了。。。),然后实现热更新 **How to implement this function** <!--Implementation steps for the solution you want. --> 1.获得客户端启动的配置文件 2.用一个线程去监听这个文件 3.当文件发生变化时,校验配置是否正确,如果正确重启服务 **Application scenarios of this function** <!--Make a clear and concise description of the application scenario of the solution you want. --> 现在想要修改映射连接需要修改配置文件,并且杀掉进程再重新启动。如果主动监听配置文件变化然后重启服务则可以减少重复操作
Author
Owner

@fatedier commented on GitHub (Jun 8, 2021):

这个问题和 https://github.com/fatedier/frp/issues/1176 重复了。

<!-- gh-comment-id:856842989 --> @fatedier commented on GitHub (Jun 8, 2021): 这个问题和 https://github.com/fatedier/frp/issues/1176 重复了。
Author
Owner

@QQ2017 commented on GitHub (Jun 20, 2021):

你不知道可以reload吗?

<!-- gh-comment-id:864568635 --> @QQ2017 commented on GitHub (Jun 20, 2021): 你不知道可以reload吗?
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#1942
No description provided.