Open gionapaolini opened 11 months ago
Please feel free to check out the GitHub issues; there have been a number of questions about this. Let me know if you're able to find the information you need.
I tried running the docker command suggested on the readme, with no proxy in front and no ssl. I still have the same issue.
tail -F /var/log/nginx/access.log | docker run -p 7890:7890 --rm -i -e LANG=$LANG allinurl/goaccess -a -o html --log-format COMBINED --real-time-html - > report.html
Tried adding --ws-url
tail -F /var/log/nginx/access.log | docker run -p 7890:7890 --rm -i -e LANG=$LANG allinurl/goaccess -a -o html --log-format COMBINED --real-time-html --ws-url=ws://{IP}:7890 - > report.html
But still no luck.
Is there something I need to configure that might not be mentioned in the readme prior to running the docker image?
Seems like there might be a problem related to the port. Is there a firewall in place that could be blocking access to port 7890? Could you also share the output from your browser's console?
I tried running a different service on the same port and it does work with no issue, so nothing is blocking that port.
Below you can find a screenshot of the browser console.
In any case, when running in debug mode (no proxy, no ssl, direct access by ip) I do receive the request, so for sure the port is working, and I get the same error from the logs:
WebSocket server ready to accept new client connections
Accepted: 11 [my-ip]
Handling read 11 [my-ip]...
Missing headers for handshake 11 [my-ip]...
Closing TCP 11 [my-ip]
Connection Closed.
Active: 0
So the browser is not passing some required headers I guess?
It seems to be working when I try connecting with the PieSocket Websocket tester extension. So it must the a browser issue which for some reason does not provide the right headers
Interesting. Could you attempt this using a different browser or in an incognito session?
I have tested it on latest version of chrome, edge and brave. Same issue each time. Maybe I'm missing something, am I supposed to hit the Websocket server directly on the browser (http://{IP}:7890) (which is what I'm currently doing) or is there a different endpoint I should hit, which then initiate the websocket connection?
Do I have to serve the report.html file? Is this what I'm missing?
are you able to access https://rt.goaccess.io using the same browser or do you get the same error message?
I am able to access it with no issues
It appears to be a configuration problem specific to your local setup. Could you try running a plain instance of goaccess without using containerization / Docker?
Using goaccess from NixOS-unstable and latest Google Chrome Canary - same exact behavior. Failed to load resource: the server responded with a status of 400 ().
My cmdline is goaccess /var/log/caddy/access-nekopon.pl.log --log-format caddy --real-time-html -o index.html
Ports are available + I ran goaccess with root permissions
GoAccess - 1.7.2.
For more details visit: https://goaccess.io/
Copyright (C) 2009-2023 by Gerardo Orellana
Build configure arguments:
--enable-utf8
--enable-geoip=mmdb
--with-openssl
@surfaceflinger Could you check if you experience the same outcomes when using different web browsers or even when using an incognito session?
@surfaceflinger Could you check if you experience the same outcomes when using different web browsers or even when using an incognito session?
ehh, sorry, I just sat to this again and looks like I didn't get how it's supposed to work and I tried to directly connect to the websocket.
The way I got it working now in a "minimal" fashion, without setting nginx etc is
darkhttpd . --port 9191 &
goaccess /var/log/caddy/access-nekopon.pl.log --log-format caddy --real-time-html -o index.html
@surfaceflinger Great to hear, appreciate the update, and I'm glad to know it's functioning correctly now.
Description:
When trying to set up GoAccess in a Docker container behind an NGINX reverse proxy to handle WebSocket connections, I consistently receive a 400 Bad Request error during the WebSocket handshake.
Setup:
GoAccess is running inside a Docker container. NGINX is set up as a reverse proxy to handle SSL and pass requests to the GoAccess container.
Steps to Reproduce:
Expected Behavior:
A successful WebSocket handshake and establishment of the connection.
Actual Behavior:
The WebSocket handshake fails, and a 400 Bad Request error is received. The GoAccess logs mention "Missing headers for handshake."
Logs:
GoAccess Logs:
Attempts to Resolve:
Checked and reconfigured NGINX to ensure it's passing the necessary headers for a WebSocket connection. Reviewed GoAccess configuration to ensure WebSocket mode is enabled. Monitored the network using developer tools in the browser. No WebSocket connection attempts are visible, just the 400 status error. Used websocat to test the WebSocket connection directly, which also resulted in a 400 Bad Request error.
Additional resources used:
Dockerfile:
Run with
tail -F /var/log/nginx/access.log | docker run -i -p 7890:7890 goaccess > report.html
NGINX Config: