title: socket is closed when trying to connect to port forwarded database
body: <p>I did the port forwarding to port <code>54320</code></p>
  <pre><code>ssh -L 54320:&lt;some host&gt;:5432 ns1
  </code></pre>
  <p>I have the connection string that looks like this</p>
  <pre><code>postgres://&lt;login&gt;:&lt;password&gt;@localhost:54320/db_name
  </code></pre>
  <p>And I am trying to connect to <code>node-postgres</code> library like this</p>
  <pre><code>    const { Client } = require('pg');
      client = new Client({ connectionString: pgConnectionString });
      await client.connect(err =&gt; {
          if (err) {
              console.error('connection error', err.stack)
          } else {
              console.log('connected')
          }
      });
  </code></pre>
  <p>However it fails with <code>connection error Error [ERR_SOCKET_CLOSED]: Socket is closed</code></p>
  <p>What is the problem? <code>pg</code> version is <code> &quot;pg&quot;: &quot;^7.11.0&quot;,</code></p>