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

init

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