Added proxy support (#1260)

This commit is contained in:
Tomas Della Vedova
2020-08-03 11:39:24 +02:00
committed by GitHub
parent 629894adba
commit 26238634a7
15 changed files with 344 additions and 6 deletions

View File

@ -692,3 +692,28 @@ expectError<errors.ConfigurationError>(
context: 'hello world'
})
)
/**
* `proxy` option
*/
expectType<Client>(
new Client({
node: 'http://localhost:9200',
proxy: 'http://localhost:8080'
})
)
expectType<Client>(
new Client({
node: 'http://localhost:9200',
proxy: new URL('http://localhost:8080')
})
)
expectError<errors.ConfigurationError>(
// @ts-expect-error
new Client({
node: 'http://localhost:9200',
proxy: 42
})
)