Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
socks5
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
socks5
Commits
e7cd5811
Commit
e7cd5811
authored
Mar 28, 2019
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
1c707645
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
3 deletions
+36
-3
app.js
app.js
+25
-2
package.json
package.json
+1
-0
test.js
test.js
+10
-1
No files found.
app.js
View file @
e7cd5811
const
socksv5
=
require
(
'
socksv5
'
)
const
shell
=
require
(
'
shelljs
'
)
const
cron
=
require
(
'
node-cron
'
);
let
authUserList
=
[]
const
PORT
=
3000
...
...
@@ -14,7 +15,7 @@ server.useAuth(socksv5.auth.UserPassword((username, password, cb) => {
async
function
isAuthUser
(
user
,
pass
,
cb
)
{
let
cashedUser
=
isUserFoundInCashe
(
user
,
pass
)
let
cashedUser
=
isUserFoundInCashe
(
user
,
pass
)
if
(
cashedUser
)
{
console
.
log
(
"
user Found in cashe
"
)
cb
(
true
)
...
...
@@ -40,7 +41,7 @@ async function radius(user, pass) {
}
function
isUserFoundInCashe
(
user
,
pass
)
{
function
isUserFoundInCashe
(
user
,
pass
)
{
for
(
let
i
=
0
;
i
<
authUserList
.
length
;
i
++
)
{
if
(
authUserList
[
i
].
user
===
user
&&
authUserList
[
i
].
pass
===
pass
)
return
true
...
...
@@ -48,3 +49,25 @@ async function radius(user, pass) {
return
false
}
cron
.
schedule
(
'
*/1 * * * * *
'
,
()
=>
{
// requestPing()
checkUser
()
});
// cronAmazon.schedule(' */5 * * * *', () => {
//
// // processScedule()
//
//
// });
async
function
checkUser
()
{
for
(
let
i
=
0
;
i
<
authUserList
.
length
;
i
++
)
{
let
auth
=
await
radius
(
authUserList
[
i
].
user
,
authUserList
[
i
].
pass
)
if
(
!
auth
)
authUserList
.
splice
(
i
,
1
)
}
}
package.json
View file @
e7cd5811
...
...
@@ -12,6 +12,7 @@
"
hashmap
"
:
"
^2.3.0
"
,
"
http-errors
"
:
"
~1.6.2
"
,
"
morgan
"
:
"
~1.9.0
"
,
"
node-cron
"
:
"
^2.0.3
"
,
"
pug
"
:
"
2.0.0-beta11
"
,
"
shelljs
"
:
"
^0.8.3
"
,
"
socksv5
"
:
"
0.0.6
"
...
...
test.js
View file @
e7cd5811
let
a
=
'
salm Access-Request of id 149 to 54.38.189.114 port 1812
'
let
arr
=
[]
arr
.
push
(
0
)
arr
.
push
(
1
)
arr
.
push
(
2
)
arr
.
push
(
3
)
arr
.
push
(
4
)
arr
.
push
(
5
)
arr
.
splice
(
3
,
1
)
console
.
log
(
a
.
includes
(
"
Access-Request
"
))
console
.
log
(
arr
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment