You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see a lot of issues on here about using web sockets. It certainly took a little fudgery for me to get it working.
If you are going to expose the same port that is listed in the --port=7890 parameter, then you should be able to get the .html output file to reference that port and connect to it.
But connecting to it securely via an Nginx reverse proxy is the angle I went for.
Setup and Nginx virtual host with TLS cert from Let's Encrypt and let it serve the static .html page. I also wanted to use Nginx to serve the web sockets, but because it's served on a port that is detailed in the static .html you can never get to it.
It works, but only because something doesn't behave as expected.
The clever bit that makes this work is the --ws-url In my Nginx config I'm going to capture /ws and redirect it to port 12390. But what actually happens is that the url that gets put into the html file is wss://host.domain/ws:7890 Why does this work? It's not a valid url the port should be before the /ws/ - thankfully it's not, because traffic is sent to wss://host.domain/ws/:7890 but the :7890 gets ignored, and web sockets gets served currently over port 443, the same as the static page is on!
Thanks for sharing these findings! I'm glad we're on the same page about the issue with the port. I'm happy to submit a patch for this, but I wanted to make sure you will be able to update your configuration after this change.
I can always update my config. But need to be sure that fixing the port does not break the --ws-url. I would suggest that if a --ws-url is specified that it does not rebuild it from other parameters, but overrides it. So even if a port is specified, it gets ignored unless no --ws-url is specified.
I made some changes to this where it should work as expected. The idea behind configuring the port via the ws-url is to get to goaccess via a reverse proxy. For instance, if you only have port 443 available/open, you could reach a goaccess instance running on 7890 as:
Please feel free to build from development and let me know if that addresses the issue on your end. Otherwise, it will be shipped in v1.7.2 soon. Thanks again!
I see a lot of issues on here about using web sockets. It certainly took a little fudgery for me to get it working.
If you are going to expose the same port that is listed in the
--port=7890
parameter, then you should be able to get the.html
output file to reference that port and connect to it.But connecting to it securely via an Nginx reverse proxy is the angle I went for.
Setup and Nginx virtual host with TLS cert from Let's Encrypt and let it serve the static
.html
page. I also wanted to use Nginx to serve the web sockets, but because it's served on a port that is detailed in the static.html
you can never get to it.It works, but only because something doesn't behave as expected.
I used a
docker-compose.yml
to serve GoAccess.The clever bit that makes this work is the
--ws-url
In my Nginx config I'm going to capture/ws
and redirect it to port 12390. But what actually happens is that the url that gets put into the html file iswss://host.domain/ws:7890
Why does this work? It's not a valid url the port should be before the/ws/
- thankfully it's not, because traffic is sent towss://host.domain/ws/:7890
but the :7890 gets ignored, and web sockets gets served currently over port 443, the same as the static page is on!My suggestion here is to not fix the
--ws-url
and if is specified please don't add the port, let that be done manually.The text was updated successfully, but these errors were encountered: