The agent function should take the Connection contructor options as argument (#1332)

This commit is contained in:
Tomas Della Vedova
2020-10-12 10:47:10 +02:00
committed by GitHub
parent ea009da3b6
commit 8ec40547fb
5 changed files with 43 additions and 23 deletions

View File

@ -149,7 +149,9 @@ const client = new Client({
const client = new Client({
node: 'http://localhost:9200',
agent: () => new CustomAgent()
// the function takes as parameter the option
// object passed to the Connection constructor
agent: (opts) => new CustomAgent()
})
const client = new Client({