-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Description
hpAgent gives this sample for using the library with GOT
got('http://localhost:9200', {
agent: {
http: new HttpProxyAgent({
keepAlive: true,
keepAliveMsecs: 1000,
maxSockets: 256,
maxFreeSockets: 256,
scheduling: 'lifo',
proxy: 'http://localhost:8080'
})
}
})Your code directly assigns whatever the user lists as a proxy agent to proxy agent
const requestOptions = {
method: 'GET',
resolveWithFullResponse: true,
gzip: true,
responseType: 'buffer',
headers: this.requestHeaders,
https: {
rejectUnauthorized: this.rejectUnauthorized,
},
agent: this.proxyAgent,
};The documentation should either reflect by updating your advanced example like so :
proxyAgent: {
http: new HttpProxyAgent({
proxy: proxyUrl
}),
},or you need to update your code so that it infers which agent was provided and does the assignment itself.
agent instanceof HttpProxyAgent -> then { http: HttpProxyAgent }
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels