frpc: support stop command (#3511)

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

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 {