mirror of
https://github.com/certd/certd.git
synced 2025-11-25 09:10:11 +08:00
chore: 代理初步
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import axios, { AxiosRequestConfig } from "axios";
|
||||
import { logger } from "./util.log.js";
|
||||
import { Logger } from "log4js";
|
||||
import { ProxyAgent } from "proxy-agent";
|
||||
import { ProxyAgent, ProxyAgentOptions } from "proxy-agent";
|
||||
export class HttpError extends Error {
|
||||
status?: number;
|
||||
statusText?: string;
|
||||
@@ -136,7 +136,7 @@ export type HttpClient = {
|
||||
request<D = any, R = any>(config: HttpRequestConfig<D>): Promise<HttpClientResponse<R>>;
|
||||
};
|
||||
|
||||
export function createAgent(opts: any = {}) {
|
||||
export function createAgent(opts: ProxyAgentOptions = {}) {
|
||||
const httpAgent = new ProxyAgent(opts);
|
||||
return {
|
||||
httpAgent,
|
||||
|
||||
Reference in New Issue
Block a user