Commit 3b6aa668 authored by Ahmad Nemati's avatar Ahmad Nemati

init

parent 7f422cf0
......@@ -61,7 +61,8 @@ async function run() {
let whiteIp = await getWhiteIp()
doIptable(whiteIp)
let portRes = await getPort()
if (portRes === '0' || portRes === '443' || port ===5)
portRes=parseInt(portRes)
if (portRes === 0 || portRes === 443 || port ===5)
port = randomInt(4000, 60000)
else
port = parseInt(portRes)
......@@ -158,6 +159,8 @@ async function calculateSpeed() {
function sendRate(rx, tx) {
const request = require('request');
if (port ===5)
return
let url = 'http://admin.fcfglobal.co:3000/rateWithPort/' + rx + '/' + tx + '/' + port
return new Promise(function (resolve, reject) {
request(url, {timeout: 6000}, function (error, res, 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