frpc: support stop command (#3511)

This commit is contained in:
fatedier authored and GitHub committed 2023-06-30 17:35:37 +08:00
1 parent 4c4d5f0d0d
commit fc4e787fe2
8 files changed
+155 -16

No files matched your search

+9
View File
@@ -62,6 +62,15 @@ func (c *Client) Reload() error {
return err
}
func (c *Client) Stop() error {
req, err := http.NewRequest("POST", "http://"+c.address+"/api/stop", nil)
if err != nil {
return err
}
_, err = c.do(req)
return err
}
func (c *Client) GetConfig() (string, error) {
req, err := http.NewRequest("GET", "http://"+c.address+"/api/config", nil)
if err != nil {