From 67c0d1117898997e044bdf04b8b95e4b498ae8aa Mon Sep 17 00:00:00 2001 From: Adhidarma Hadiwinoto <me@adhisimon.org> Date: Mon, 11 Mar 2019 13:50:43 +0700 Subject: [PATCH] Perbaikan deteksi ip --- index.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.js b/index.js index b713b5b..8d45f04 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,6 @@ process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'; -const URL = require('url'); const fs = require('fs'); const isIp = require('is-ip'); const config = require(__dirname + '/config.json'); @@ -25,7 +24,7 @@ for (let i=0; i < hostsCount; i++) { } else { - if (isIp(URL.parse(host.host).hostname)) { + if (isIp(host.host.split('/')[0])) { console.log('Register ' + host.host + ' without SSL') redbird.register(host.host, host.target, optionsWoSSL); } -- 1.9.0