-
-
Notifications
You must be signed in to change notification settings - Fork 335
Closed
Description
filter: function (infoHash, params, cb) {
console.log(infoHash, params.event, params.peer_id, params.downloaded, params.uploaded)
// filter users
// Here: var User = mongoose.model('User', new mongoose.Schema(...))
const userId = params.peer_id.substring(16, 40)
User.findById(userId, function(err, user) {
if (err) throw err
if (user == null) cb(new Error('disallowed user ' + userId))
else cb(null)
})
}
Sometimes it works, but often it does not.
Metadata
Metadata
Assignees
Labels
No labels