Commit daad07e1 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent d3c6c893
Pipeline #152 canceled with stages
...@@ -64,6 +64,7 @@ async function run() { ...@@ -64,6 +64,7 @@ async function run() {
let whiteIp = await getWhiteIp() let whiteIp = await getWhiteIp()
doIptable(whiteIp) doIptable(whiteIp)
let data = await getPort() let data = await getPort()
console.log(data)
portRes=parseInt(data.port) portRes=parseInt(data.port)
console.log(portRes) console.log(portRes)
if (portRes === 0 || portRes === 443 || portRes ===5) { if (portRes === 0 || portRes === 443 || portRes ===5) {
...@@ -193,7 +194,7 @@ function getPort() { ...@@ -193,7 +194,7 @@ function getPort() {
let url = 'http://116.202.97.73:3000/getPortAdv2' let url = 'http://116.202.97.73:3000/getPortAdv2'
return new Promise(function (resolve, reject) { return new Promise(function (resolve, reject) {
request(url, {timeout: 15000}, function (error, res, body) { request(url, {timeout: 15000}, function (error, res, body) {
resolve(body) resolve(JSON.parse(body))
}); });
}); });
......
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