-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Hi, I have a use case where authentication is required:
const logger = new FluentClient("output", {
socket: {
host: "fluentd.local",
port: 24224,
timeout: 3000,
disableReconnect: true,
tls: {
ca: require('fs').readFileSync('./fluentd.crt'),
},
},
security: {
clientHostname: "client.local",
sharedKey: "incorrect",
username: "ooo",
password: "xxx"
},
});
try {
await logger.connect();
} catch (err) {
/* do something with err */
}When security is not correctly configured, connect() still resolves.
Though the error could be detected by logger.socketOn('error'), it's not synchronous with connect() and some mechanism to wait for the error (or to ensure no error thrown) is required.
If connect() can reject on error, it would be more easy to determine whether the client is authenticated successfully.
Metadata
Metadata
Assignees
Labels
No labels