Skip to content

fix: typo error in readme - #123

Open
warjiang wants to merge 1 commit into
delvedor:mainfrom
warjiang:fix/typo-error
Open

fix: typo error in readme#123
warjiang wants to merge 1 commit into
delvedor:mainfrom
warjiang:fix/typo-error

Conversation

@warjiang

@warjiang warjiang commented Mar 3, 2025

Copy link
Copy Markdown

the proxyConnectOptions should be corrected as proxyRequestOptions. no matter for HttpProxyAgent or HttpsProxyAgent, the agent class use proxyRequestOptions:

for HttpProxyAgent

hpagent/index.js

Lines 17 to 28 in 96f45f1

createConnection (options, callback) {
const requestOptions = {
...this.proxyRequestOptions,
method: 'CONNECT',
host: this.proxy.hostname,
port: this.proxy.port,
path: `${options.host}:${options.port}`,
setHost: false,
headers: { ...this.proxyRequestOptions.headers, connection: this.keepAlive ? 'keep-alive' : 'close', host: `${options.host}:${options.port}` },
agent: false,
timeout: options.timeout || 0
}

for HttpsProxyAgent

hpagent/index.js

Lines 74 to 86 in 96f45f1

createConnection (options, callback) {
const requestOptions = {
...this.proxyRequestOptions,
method: 'CONNECT',
host: this.proxy.hostname,
port: this.proxy.port,
path: `${options.host}:${options.port}`,
setHost: false,
headers: { ...this.proxyRequestOptions.headers, connection: this.keepAlive ? 'keep-alive' : 'close', host: `${options.host}:${options.port}` },
agent: false,
timeout: options.timeout || 0
}

@warjiang

warjiang commented Mar 3, 2025

Copy link
Copy Markdown
Author

@delvedor could help me review that ~

@mbtools mbtools left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mbtools

mbtools commented Nov 13, 2025

Copy link
Copy Markdown

Duplicate of #117

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants