title: can't connect on minio with node js
body: <ul>
  <li>i tried to connect on minio with node js using minioClient</li>
  <li>this is my code</li>
  </ul>
  <p><strong>Minio.js</strong></p>
  <pre><code>const Minio = require('minio')
  const minioClient = new Minio.Client({
     endPoint: 'xxxxxx',
     port: 9000,
     useSSL: true,
     accessKey: 'xxxxxx',
     secretKey: 'xxxx'
  });
  
  module.exports = minioClient
  </code></pre>
  <p><strong>fileupload.js</strong></p>
  <pre><code>const minioClient = require('../config/connection/Minio')
  module.exports = minioUpload = {
      upload: async(req, res) =&gt; {
  
          if (req.file) {
              var metaData = {
                  'Content-Type': 'application/octet-stream',
                  'X-Amz-Meta-Testing': 1234,
                  'example': 5678
              }
  
              var originalname = req.file.originalname.split(' ');
              const fileName = originalname.join('_');
              try {
  
                  // Using fPutObject API upload your file to the bucket maztou.
                  minioClient.putObject('maztou', fileName, req.file.buffer, metaData, function(err, etag) {
                      if (err) return console.log(err)
                      return res.status(201).json('File uploaded successfully.', fileName)
                  });
              } catch (err) {
                  console.log(err, '&lt;== ERROR');
              }
          }
      }
  }
  </code></pre>
  <p><strong>router.js</strong></p>
  <pre><code>const express = require('express')
  const minioUpload = require('../controllers/fileupload')
  const router = express.Router()
  const multer = require('multer')
  router.route('/uploads').post(multer({ storage: multer.memoryStorage() }).single(&quot;file&quot;), minioUpload.upload)
  
  module.exports = router
  </code></pre>
  <p>And the server return this :</p>
  <pre><code>Error: connect ETIMEDOUT XXXX:9000
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1146:16) {
    errno: -60,
    code: 'ETIMEDOUT',
    syscall: 'connect',
    address: 'XXXX',
    port: 9000
  }
  </code></pre>
  <p>Can some one help me for this issus, i'have already read all the documentation about minioClient , all my setup is good, and i have. this issus !</p>