allinurl / goaccess

GoAccess is a real-time web log analyzer and interactive viewer that runs in a terminal in *nix systems or through your browser.
https://goaccess.io
MIT License
18.21k stars 1.1k forks source link

Realtime report not working - Websocket: Connection closed before receiving a handshake response #2467

Open KapriQ opened 1 year ago

KapriQ commented 1 year ago

Please can anyone help me with following error?

WebSocket connection to 'wss://mydomain.com:7890/' failed: Connection closed before receiving a handshake response

goaccess /var/www/html/access.log --ignore-crawlers --ssl-cert=/etc/letsencrypt/live/mydomain.com/fullchain.pem --ssl-key=/etc/letsencrypt/live/mydomain.com/privkey.pem -o /var/www/html/admin1234/report/report.html --ws-url=wss://mydomain.com:7890 --real-time-html

Screenshot from 2023-02-17 16-22-05

TELNET? Yes, i can telnet via 7890 PORT.

allinurl commented 1 year ago

Sounds like a TLS/certificate issue, have you tried running it with out SSL/TLS and see if that works?

KapriQ commented 1 year ago

Haven't tried w/o SSL, and i even don't want to. :/

Is there anyway to see, what exactly is the problem with the certificate? Or any way how to solve it?

If not, i am fine with it, i can live with that, i have already set up the cron to be report refreshed every 11minutes, so ...

allinurl commented 1 year ago

Reason I asked about trying it without TLS is for debugging purposes.

Are you accessing via https://...? also is your http server on a different location than the WS server/goaccess? otherwise I'd try without --ws-url.

KapriQ commented 1 year ago

I know why you have asked for it to try w/o SSL :). But i can't try it due to web in production.

Yes, the report.html is accessed via https://... , my website and also goaccess are under same server/machine installed. LAMP

Without --ws-url: is not listening websocket and following errors are shown in console:

Screenshot from 2023-02-17 17-20-59

allinurl commented 1 year ago

Is the blurred URL on the first screenshot the same as the second screenshot?

KapriQ commented 1 year ago

Yes, of course, the URL is the same. just wss://MYDOMAIN.com:7890

allinurl commented 1 year ago

So I'm not sure why the browser would give a different error message if it's connecting to the same address. I'd go with the latter and assume that either you may be behind some proxy or it's unable to reach the server for some reason.