feat(proxy): add proxy switch endpoint to enable/disable proxies, and all enabled parameter to display the status of each proxy when fetching the proxies list

This commit is contained in:
2026-06-06 16:13:30 +08:00
parent a0634703ea
commit f649345375
4 changed files with 251 additions and 10 deletions
+49 -2
View File
@@ -1255,6 +1255,51 @@ X-Timestamp: 1704067200000
---
## Proxy Switch
**Endpoint:** `/frpcAct/proxyMgr/switch`
**Method:** POST
**Auth Required:** Yes (token)
**Permission Level:** Admin
Switch the status of a proxy.
**Request Headers:**
```
X-Token: your_token
X-Timestamp: 1704067200000
```
| Header | Type | Required | Description |
|--------|------|----------|-------------|
| X-Token | string | Yes | Authentication token |
| X-Timestamp | int64 | Yes | Client timestamp in milliseconds |
**Request Body:**
```json
{
"instanceID": 1,
"proxyName": "test",
"action": 1
}
| Field | Type | Description |
|-------|------|-------------|
| instanceID | int | Instance ID |
| proxyName | string | Name of the created proxy |
| action | string | Enable or disable the current proxy. 0 is disable, 1 is enable |
**Response:**
```json
{
"success": true,
"message": "Proxy status has been switched to off."
}
```
---
## List Proxies
**Endpoint:** `/frpcAct/proxyMgr/list`
@@ -1298,14 +1343,16 @@ X-Timestamp: 1704067200000
"type": "tcp",
"localIP": "127.0.0.1",
"localPort": "22",
"remotePort": "6000"
"remotePort": "6000",
"enabled": true
},
{
"name": "web_proxy",
"type": "http",
"localIP": "127.0.0.1",
"localPort": "8080",
"remotePort": "80"
"remotePort": "80",
"enabled": false
}
]
}