jesec / flood

A modern web UI for various torrent clients with a Node.js backend and React frontend.
https://flood.js.org
GNU General Public License v3.0
2.23k stars 135 forks source link

Issues while downloading static assets with SSL and HTTP/2 #524

Closed alexandresoro closed 2 years ago

alexandresoro commented 2 years ago

Type: Bug Report

Your Environment

Summary

When launching flood with self-signed certificates and useSsl = true, assets have difficulty to download and return the following in the browser console:

Failed to load resource: net::ERR_HTTP2_PROTOCOL_ERROR

The consequence is that pages are painful to load and not working as expected.

Issue does not seems to occur with Node <14

Expected Behavior

Web app should load and work similarly as when SSL is not activated

Current Behavior

Web app load breaks because static assets are not properly loaded.

Possible Solution

My understanding is that when SSL is active, the server relies on spdy library as web server. I have checked and flood is using the latest released version. The behavior is similar to the one described here: https://github.com/spdy-http2/node-spdy/issues/380 so I suspect that there is no easy fix.

My suggestions would be to find another library as this one does not seem maintained anymore.

It also seems that HTTP/2 and SSL are supported natively by Node as per https://nodejs.org/docs/latest-v16.x/api/http2.html so another solution would be maybe to migrate to this.

Steps to Reproduce

  1. Launch flood with useSsl=true and provide valid certificates (I did it with self-signed)
  2. Log in with a valid account

Context

alexandresoro commented 2 years ago

I may be missing something but I don’t see why we couldn’t migrate to the native node library. If this is OK, I could have a look and provide a MR.

alexandresoro commented 2 years ago

On second thought, it seems not to be as trivial as I thought, and I saw that there was a WIP to migrate to fastify. It would make more sense to tackle this with this migration maybe…

ChristopherTheBoss commented 2 years ago

Glad this issue is resolved