If you use https to protect traffic between esjs client and the nodes in your cluster then you also can't use sniffing. This is because we use the /_nodes/_all/clear output to populate the connection pool and that API does not know that the nodes speak HTTPS at all. This change implements the config.sniffedNodesProtocol to fix this.
As it is implemented here, the sniffedNodesProtocol can be set to a string which will be used as the protocol configuration for each Host object created durring sniffing, plain and simple. The default value for this configuration depends on the hosts initially passed to the client, if all of the nodes have the same protocol that protocol is used. If your nodes list is empty or there is a mixture of protocols in this list then "http" is used, as it is the default protocol for each host.
- flatten auth config to an Authorization header when the Host is created
- remove individual Authorization handling from connectors
- removed incomplete support for per-request auth
- use per-request headers to provide your own Authorization header per request
http connector. On one hand, the response is handled with buffers
instead of assuming it is a string, and then depending on the
presence of the "content-encoding" header, will try to uncompress
the response or return it as it is. Either way, it will try to
handle the final result as an utf8 encoded string
Now, it will properly ignore nodes without HTTP enabled, and nodes with addresses that don't match the pattern will not cause all hell to break loose but rather log an error message and cancel the sniff.
Also comes with minor updates to the API.