feat: implement ProxyAgent support and update HTTP options for improved proxy handling

This commit is contained in:
Elysia
2024-12-13 20:19:09 +07:00
parent d4bace98b3
commit 1bb7203a66
7 changed files with 50 additions and 33 deletions

4
typings/index.d.ts vendored
View File

@@ -61,7 +61,7 @@ import {
import { ChildProcess, ChildProcessWithoutNullStreams } from 'node:child_process';
import { EventEmitter } from 'node:events';
import { AgentOptions } from 'node:https';
import { Response } from 'undici';
import { Response, ProxyAgent } from 'undici';
import { Readable, Writable, Stream } from 'node:stream';
import { MessagePort, Worker } from 'node:worker_threads';
import * as WebSocket from 'ws';
@@ -6726,7 +6726,7 @@ export interface HTTPErrorData {
}
export interface HTTPOptions {
agent?: Omit<AgentOptions, 'keepAlive'>;
agent?: Omit<ProxyAgent.Options, 'keepAlive'>;
api?: string;
version?: number;
host?: string;