Commit e454a94b authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 555e96e5
......@@ -9,19 +9,21 @@ const server = socksv5.createServer((_, resolve) => resolve())
server.listen(PORT, () => console.log(`Listen: localhost:${PORT}`))
server.useAuth(socksv5.auth.UserPassword((username, password, cb) => {
console.log('user ' + username + ' ' + ' pass ' + password)
//isAuthUser(username, password, cb)
isAuthUser(username, password, cb)
}))
async function isAuthUser(user, pass, cb) {
let cashedUser = await isUserFoundInCashe(user, pass, cb)
if (cashedUser) {
console.log("user Found in cashe")
cb(true)
return true
}
let isRadiusUser = await radius(user, pass)
if (isRadiusUser) {
console.log("user Found in Radius")
cb(true)
authUserList.push({user: user, pass: pass})
return true
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment