Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/RequestExecutor/HttpRequestExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { RequestExecutorOptions } from './RequestExecutorOptions';
import { NormalizeZlibDeflateTransformStream } from '../Utils/NormalizeZlibDeflateTransformStream';
import { CertificatesCache } from './CertificatesCache';
import { CertificatesResolver } from './CertificatesResolver';
import { RequestExecutorConstants } from './RequestExecutorConstants';
import { inject, injectable } from 'tsyringe';
import iconv from 'iconv-lite';
import { safeParse } from 'fast-content-type-parse';
Expand Down Expand Up @@ -218,7 +219,8 @@ export class HttpRequestExecutor implements RequestExecutor {
pfx: request.pfx,
passphrase: request.passphrase,
method: request.method,
rejectUnauthorized: false
rejectUnauthorized: false,
maxHeaderSize: RequestExecutorConstants.MAX_HEADERS_SIZE
};
}

Expand Down
3 changes: 3 additions & 0 deletions src/RequestExecutor/RequestExecutorConstants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export class RequestExecutorConstants {
public static readonly MAX_HEADERS_SIZE = 32768;
}
4 changes: 3 additions & 1 deletion src/RequestExecutor/WsRequestExecutor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Helpers, logger, ProxyFactory } from '../Utils';
import { RequestExecutorOptions } from './RequestExecutorOptions';
import { CertificatesCache } from './CertificatesCache';
import { CertificatesResolver } from './CertificatesResolver';
import { RequestExecutorConstants } from './RequestExecutorConstants';
import { inject, injectable } from 'tsyringe';
import WebSocket from 'ws';
import { once } from 'node:events';
Expand Down Expand Up @@ -180,7 +181,8 @@ export class WsRequestExecutor implements RequestExecutor {
headers: this.normalizeHeaders(request.headers),
ca: request.ca,
pfx: request.pfx,
passphrase: request.passphrase
passphrase: request.passphrase,
maxHeaderSize: RequestExecutorConstants.MAX_HEADERS_SIZE
});

const res: IncomingMessage = await this.connect(client);
Expand Down
3 changes: 0 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
process.env.UV_THREADPOOL_SIZE = String(1024);
process.env.NODE_OPTIONS = `${
process.env.NODE_OPTIONS ?? ''
} --max-http-header-size=40960`.trim();
import 'reflect-metadata';
import {
PollingScanStatus,
Expand Down