diff options
Diffstat (limited to 'src/api')
| -rw-r--r-- | src/api/proxies.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/api/proxies.ts b/src/api/proxies.ts index 0b98bd0..302014c 100644 --- a/src/api/proxies.ts +++ b/src/api/proxies.ts @@ -1,4 +1,5 @@ import { getURLAndInit } from '../misc/request-helper'; +import { ClashAPIConfig } from '../types'; const endpoint = '/proxies'; @@ -76,3 +77,18 @@ export async function healthcheckProviderByName(config, name) { options ); } + +export async function healthcheckProviderProxy( + config: ClashAPIConfig, + providerName: string, + proxyName: string +) { + const { url, init } = getURLAndInit(config); + const options = { ...init, method: 'GET' }; + return await fetch( + `${url}/providers/proxies/${encodeURIComponent(providerName)}/${encodeURIComponent( + proxyName + )}/healthcheck`, + options + ); +} |
