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lib/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/ssh-tunnel@2.3.23/lib/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n* Module dependencies: Core\n*/\nvar app = require('./app');\n\n/**\n* Module dependencies: FileSystem\n*/\nvar path = require('path');\nvar dirname = path.dirname;\nvar basename = path.basename;\nvar fs = require('fs');\nvar exists = fs.existsSync;\n\n/**\n* Module dependencies: Process\n*/\nvar child_process = require('child_process');\nvar spawn = child_process.spawn;\nvar exec = child_process.exec;\n\n/**\n* Module dependencies: Utilities\n*/\nvar _ = require('underscore'); \n\n/**\n* Module dependencies: Terminal\n*/\nvar colors = require('colors');\n\n/**\n* Module configuration\n*/\nvar debug = true;\n\n/**\n* Module definition\n*/\nexports = module.exports = new Tunnel();\n\n/**\n* Module extension\n*/\nexports.Tunnel = Tunnel;\n\n/**\n * Initialize a new `Tunnel`.\n *\n * @param {Object} options\n * @api public\n */\n\nfunction Tunnel(options) {\n\n}\n\n/**\n * Inherit from `EventEmitter.prototype`.\n */\nTunnel.prototype.__proto__ = require('events').EventEmitter.prototype;\n\n/**\n * @api public\n */      \nTunnel.prototype.connect = function(localHostname, localPort, remoteNetwork, remoteHostname, remotePort, remoteUser){\n  var cmd = 'ssh -N -L '+localPort+':'+remoteHostname+':'+remotePort+' '+remoteUser+'@'+remoteNetwork;  \n  delegateExecCall(this, cmd, 'connect');  \n};\n\n/**\n * Install ssh key on remote machine (passwordless auth)\n *\n * @api public\n */  \nTunnel.prototype.install = function(remoteNetwork, remoteUser){\n  var cmd = 'ssh-copy-id '+remoteUser+'@'+remoteNetwork;\n  delegateExecCall(this, cmd, 'install');\n};\n\n/**\n * Install ssh key on remote machine (passwordless auth)\n *\n * @api public\n */  \nTunnel.prototype.selfupdate = function(){\n  var cmd = 'sudo npm update -g ssh-tunnel';\n  delegateExecCall(this, cmd, 'selfupdate');\n};\n\n/**\n * Load configuration from disk\n *\n * @api public\n */  \nTunnel.prototype.load = function(options){\n  var options = options || {};\n  return app.init(options);\n};\n\n/**\n * Miscellaneous helpers\n * \n * TODO: clean implementation\n */\nfunction delegateExecCall(tunnel, cmd, event){\n  tunnel.emit(event);\n  if(debug) console.log(cmd);  \n  exec(cmd, function(err, stdout, stderr){\n    logExecCall(err, stdout, stderr);\n  });\n}\n\nfunction logExecCall(err, stdout, stderr){  \n  if(typeof(stderr)!='undefined' && stderr!=null) { \n    console.log();\n    console.log(stderr.error); \n  }\n  if(typeof(err)!='undefined' && err!=null) {\n    console.log(JSON.stringify(err, undefined, 2));\n  }\n  if(typeof(stdout)!='undefined') { \n    console.log(stdout.verbose);  \n  }\n}"]}