https support

Este commit está contenido en:
manalejandro
2018-07-23 21:45:48 +02:00
padre a08fa4d353
commit cf27817687
Se han modificado 2 ficheros con 7 adiciones y 4 borrados

Ver fichero

@@ -1,7 +1,9 @@
const fs = require('fs'),
request = require('request'),
Agent = require('socks5-http-client/lib/Agent'),
host = process.argv[2]
host = process.argv[2],
Agent = host.match(/https.*/) ?
require('socks5-https-client/lib/Agent') :
require('socks5-http-client/lib/Agent')
fs.readFile(__dirname + '/path.txt', 'utf8', (err, data) => {
if (err) console.log(err)

Ver fichero

@@ -17,6 +17,7 @@
"license": "MIT",
"dependencies": {
"request": "^2.87.0",
"socks5-http-client": "^1.0.4"
"socks5-http-client": "^1.0.4",
"socks5-https-client": "^1.2.1"
}
}
}