Preact-cli: Lighthouse http issue

Created on 13 Jul 2017  路  10Comments  路  Source: preactjs/preact-cli

When lighthouse tries to check if http redirects to https (I think) it encounters an error (ERR_CONNECTION_RESET)
This site can鈥檛 be reached

So http://localhost:8080/ doesn't work

Can anyone try to reproduce this issue?

I used npm run serve for this

stale

All 10 comments

Hi @unlocomqx, does opening https://localhost:8080 work without any SSL errors ? Seems like certificates are incorrect. What os are you on?

I just checked this issue, it works fine for me. Although if https is used, its better to redirect him to https even if he opens in http. Could that be possible?

Chrome is showing "Valid cert" in the security tab of the devtools
I switched to using a h2 apache local server pointing to my build dir for now but I'll try to investigate this ERR_CONNECTION_RESET problem
So I'm fine for now but I'm still curious

When I open http://localhost:8080 this error comes up
http: TLS handshake error from [::1]:58618: read tcp [::1]:8080->[::1]:58618: use of closed network connection

I'm on windows 10 x64

It seems similar to https://github.com/GoogleChrome/simplehttp2server/issues/16

Hi @unlocomqx - is it possible you have a Firewall prevent this from working? You can check by spawning the server on a different port:

PORT=9090 npm start

then open http://localhost:9090

I already opened all ports temporarily to make a test but nothing works.
I also tried 9090 and also other hosts but no success
I opened this issue https://github.com/GoogleChrome/simplehttp2server/issues/33 hoping I could find a solution
Thank you for this awesome framework, I'm getting the hang of it and it's great!

Perfect, we'll track there and only close this issue once it's resolved :)

Same issue here.
Can't run lighthouse after preact build and preact serve.
Seems like at some point lighthouse tries to redirect to http instead of https causing this ugly error :

http2: server: error reading preface from client [::1]:39646: read tcp [::1]:8080->[::1]:39646: read: connection reset by peer
  http2: server: error reading preface from client [::1]:39650: read tcp [::1]:8080->[::1]:39650: read: connection reset by peer
http2: server: error reading preface from client [::1]:39652: read tcp [::1]:8080->[::1]:39652: read: connection reset by peer
http2: server: error reading preface from client [::1]:39648: read tcp [::1]:8080->[::1]:39648: read: connection reset by peer
http2: server: error reading preface from client [::1]:39654: read tcp [::1]:8080->[::1]:39654: read: connection reset by peer
  http: TLS handshake error from [::1]:39672: read tcp [::1]:8080->[::1]:39672: use of closed network connection

P.S: working on Ubuntu 16.04

@Jonarod check the issue I linked above, it's a know issue with simplehttp2server
I ended up creating a http2 nginx server pointing to my build directory to have proper redirection and lighthouse audits.
Lighthouse will test your http > https redirection that's why it makes a http request
https://developers.google.com/web/tools/lighthouse/audits/http-redirects-to-https

Mmmm too much for me sorry: I lost like 1h just to understand how to:

  1. setup nginx
  2. generate self-signed certificate
  3. Make it work locally

I ended up with serve-https from npm.

Quick and easy:

npm install --global [email protected]

then browsing to my /build repo and finally:


And we're good to go !!

Was this page helpful?
0 / 5 - 0 ratings