You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 14, 2024. It is now read-only.
I have taken multiple Packet Captures trying to figure out why ECONNRESET's occur.
I have found that even though you are not attempting to do any binds or LDAP actions that LDAPJS will try to connect to our LDAP server and eventually disconnect and just keep trying to re-connect.
This behavior doesn't seem to be by design. Can we get some clarification on this?
The text was updated successfully, but these errors were encountered:
I was fighting with this recently and after reviewing the client file in the library I realized the idle event wasn't being emitted if I didn't create a bind first. I haven't spent too much time reviewing this code to see what is going on, but if I have time one day maybe I can create a pull request. For now I will likely default back to using OpenLDAP library.
You can hook up to the idle event like so:
const client = ldap.createClient({
url: `ldap://my-dc`,
idleTimeout: 10 // Close due to inactivity
});
client.on('idle', event => {
console.log("Timed out")
});
// Timed out is never printed
The result of this was I never received a idle event, so I decided to put a test bind in there and I started to received the idle event.
const ldap = require('ldapjs');
const client = ldap.createClient({
url: `ldap://my-dc`,
idleTimeout: 10 // Close due to inactivity
});
client.bind("user@domain.com","Password", (err,res) => {
if(err)
console.log(err)
});
client.on('idle', event => {
console.log("Timed out")
});
// Console now prints Timed out
It sounds like the library assumes every connection will at least perform an anonymous bind before issuing any other messages. And this assumption leads to the idle code relying on the bind to be performed before it kicks in. I'd consider a PR that changes this or at least one that documents this behavior.
I have taken multiple Packet Captures trying to figure out why ECONNRESET's occur.
I have found that even though you are not attempting to do any binds or LDAP actions that LDAPJS will try to connect to our LDAP server and eventually disconnect and just keep trying to re-connect.
This behavior doesn't seem to be by design. Can we get some clarification on this?
The text was updated successfully, but these errors were encountered: