title: "Error: getaddrinfo ENOTFOUND SSH" in GetAddrInfoReqWrap.onlookup
body: <p>On mysql workbench, I connected to a remote database with connection method, <code>Standard TCP/IP over SSH</code>. But I am having trouble to make the same connection in <code>node.js</code>.</p>
  
  <p>The connection parameters I have used in MySQL workbench are:
  <code>SSH Hostname</code>, <code>SSH Username</code>, <code>SSH Password</code>, <code>MySQL Hostname</code>, <code>MySQL Server Port</code>, <code>Username</code>. Other parameters including <code>Password</code> are left empty.</p>
  
  <pre><code>var mysql = require("mysql2");
  var Client = require("ssh2").Client;
  var ssh = new Client();
  
  var db2 = new Promise(function(resolve, reject) {
    ssh
      .on("ready", function() {
        ssh.forwardOut(
          // source address, this can usually be any valid address
          "127.0.0.1",
          // source port, this can be any valid port number
          12345,
          // destination address (localhost here refers to the SSH server)
          "127.0.0.1",
          // destination port
          3306,
          function(err, stream) {
            console.log(stream);
            if (err) throw err; // SSH error: can also send error in promise ex. reject(err)
            // use `sql` connection as usual
            connection = mysql.createConnection({
              host: "MySQL Hostname",
              user: "username",
              password: "",
              database: "Default Schema",
              stream: stream
            });
  
            // send connection back in variable depending on success or not
            connnection.connect(function(err) {
              if (err) {
                resolve(connection);
              } else {
                reject(err);
              }
            });
          }
        );
      })
      .connect({
        host: "SSH Hostname",
        port: 22,
        username: "SSH Username",
        password: "SSH Password"
      });
  });
  
  
  module.exports = db2;
  </code></pre>
  
  <p>The following is the error message:</p>
  
  <pre><code>Error: getaddrinfo ENOTFOUND SSH Hostname SSH Hostname:22
      at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:56:26)
  Emitted 'error' event at:
      at Socket.&lt;anonymous&gt; (C:\Users\Sihoon Kim\Desktop\development\inventory_management\node_modules\ssh2\lib\client.js:306:10)
      at Socket.emit (events.js:189:13)
      at emitErrorNT (internal/streams/destroy.js:82:8)
      at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
      at process._tickCallback (internal/process/next_tick.js:63:19)
  </code></pre>