1
0

proxy.ts 575 B

123456789101112131415161718
  1. import { http } from './http'
  2. import type { GetProxyResponse, ProxyStatsInfo, TrafficResponse } from '../types/proxy'
  3. export const getProxiesByType = (type: string) => {
  4. return http.get<GetProxyResponse>(`../api/proxy/${type}`)
  5. }
  6. export const getProxy = (type: string, name: string) => {
  7. return http.get<ProxyStatsInfo>(`../api/proxy/${type}/${name}`)
  8. }
  9. export const getProxyTraffic = (name: string) => {
  10. return http.get<TrafficResponse>(`../api/traffic/${name}`)
  11. }
  12. export const clearOfflineProxies = () => {
  13. return http.delete('../api/proxies?status=offline')
  14. }