Commit 19db22fe authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent d42d755c
......@@ -3,7 +3,7 @@ const shell = require('shelljs')
const cron = require('node-cron');
let authUserList = []
const PORT = 3000
const PORT = 1010
const server = socksv5.createServer((_, resolve) => resolve())
......@@ -17,14 +17,12 @@ async function isAuthUser(user, pass, cb) {
let cashedUser = isUserFoundInCashe(user, pass)
if (cashedUser) {
console.log("user Found in cache")
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
......@@ -52,6 +50,7 @@ function isUserFoundInCashe(user, pass) {
cron.schedule(' * */1 * * *', () => {
// requestPing()
console.log("Try Check User")
checkUser()
});
......
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