Comments (3)
I think I see now. I presumed it would just spit the output directly into my browser out of the pipe.
I did not know I needed to run some sort of web server or HTML file. From the demos, it did not seem necessary. Perhaps I presumed too much :D
Still, very cool indeed. Got it working.
I like your other project, goaccess. I was wondering if I could customize some of those subsections of the dashboard because it looks wicked awesome by default. I mainly just wanted straight output like this but for multiple commands on a ceph cluster. Perhaps I will review or open a ticket if I have a question.
Thanks for the quick reply.
from gwsocket.
How are you running gwsocket? I'd try this (make sure port 7890 is opened)
1.- Start the websocket server
$ gwsocket &
2.- Send data from the server to the browser
$ tail -f /var/log/syslog > /tmp/wspipein.fifo
3.- Then create an html file, e.g., logs.html
that connects to the server (make sure you are pointing to the right IP/host where the gwsocket server is running and the port is open). In your case, it seems you are running gwsocket on the same machine as your syslog, so localhost would work.
<!DOCTYPE html>
<html lang="en">
<script>
window.onload = function() {
function $(selector) {
return document.querySelector(selector);
}
var socket = new WebSocket('ws://localhost:7890');
socket.onopen = function(event) {
$('#messages').innerHTML = 'Connected<br>';
};
socket.onmessage = function(event) {
$('#messages').innerHTML += event.data + '<br>';
};
socket.onclose = function(event) {
$('#messages').innerHTML = 'Disconnected ' + event.reason;
};
};
</script>
<div id="page-wrapper">
<pre id="messages">Connecting...</pre>
</div>
4.- Open the html file (Ctrl+o) and you should see your data from the server in the browser. Or just use file:///home/user/logs.html
Let me know if that helps.
from gwsocket.
That's right, you need to connect your web-page/app using a WebSocket to the gwsocket server. I'll make some changes to the documentation to make it a bit more clear. Thanks for the feedback :)
You can customize GoAccess' dashboard to a certain extend. Please take a look at the man page for more details.
Closing this. Feel free to reopen it if needed.
from gwsocket.
Related Issues (20)
- maybe a bug for http response field HOT 2
- Listening on IPv6. HOT 2
- Serving files via sendfile HOT 2
- Using in multible domains on one port HOT 3
- Fails to compile with OpenSSL 1.1.0 or newer HOT 3
- gwsocket+apache: status 200 instead of 101 HOT 2
- Strict protocol parsing HOT 7
- Support for multiple instances? HOT 8
- Is webshell considered to be integrated into the project? HOT 2
- Feature request - client version of gwsocket (same style as gwsocket, but client, not server)
- " unrecognized option `--ssl-cert' " HOT 13
- make fails on Ubuntu 20. HOT 3
- TAR Download broken HOT 2
- -Wno-missing-field-initializers on SPARC machine HOT 5
- Help with FIFO Error. Bad address HOT 11
- How can I get the same text formatting effect as on the website? HOT 2
- gwsocket as a library HOT 7
- gwsocket.io: :( Nope, the connection is out. Try again later! HOT 2
- Cant get it to work with openssl HOT 7
- do gwsocket writes to disk even with --std?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gwsocket.