title: XHR upload onprogress Event not Working on HTTPS Connection
body: <p>I have a setup for uploading files to AWS S3 via Angular 7 and Node.Js. The upload works fine. But there is an issue with the <code>xhr.upload.onprogress</code> event.</p>
  
  <p>This event is only triggered when hosting the server via <code>http</code>. When using an <code>https</code> connection, the event isn't triggered once.</p>
  
  <p>I tested it on heroku and my EC2 instance and came to the conclusion that only <code>http</code> works. Therefore, my production app hosted on AWS via <code>https</code>, doesn't work, either.</p>
  
  <p>Here is the code (write a comment if more details are needed):</p>
  
  <p><strong>Angular Service (Frontend)</strong></p>
  
  <pre><code>const xhr = new XMLHttpRequest();
  let progress = 0;
  xhr.upload.onprogress = (event: ProgressEvent) =&gt; {
      console.log('xhr on upload', event);
      if (event.lengthComputable) {
          progress = 100 * (event.loaded / event.total);
          console.log('file upload progress', { progress, file });
      }
  };
  xhr.responseType = 'json';
  xhr.open('POST', `${API_URL}/${this.API_PATH}/upload`, true);
  xhr.setRequestHeader('authorization', this.authService.getAuthToken());
  xhr.send(payload);
  xhr.onload = () =&gt; {
      observer.next(xhr.response);
      observer.complete();
      alive = false;
  };
  </code></pre>
  
  <p><strong>Node.Js</strong></p>
  
  <pre><code>module.exports = async (req, res) =&gt; {
      try {
          const busboy = new Busboy({ headers: req.headers })
          busboy.on('finish', async () =&gt; {
              const fileData = req.files.file
              const fileId = req.body.fileId
              await uploadToAws(fileData)
              // ...
          })
          req.pipe(busboy)
      } catch (err) { /* ... */ }
  }
  const uploadToAws = async (fileData, file) =&gt; {
      return new Promise((resolve, reject) =&gt; {
          const params = {
              Body: fileData.data,
              Bucket: awsConfig.buckets.drakery,
              ContentType: fileData.mimetype,
              Key: `mykey`,
              StorageClass: 'ONEZONE_IA',
          }
          awsConfig.s3
          .upload(params, (err, data) =&gt; err ? reject(err) : resolve(data.Location))
          .on('httpUploadProgress', function (evt) {
              console.log('httpUploadProgress', evt);
          })
  })
  </code></pre>
  
  <p>I am really confused why this is happening. I couldn't find any resources online on this problem.</p>
  
  <p>I am really thankful for every help!</p>
  
  <p>Thanks</p>