allinurl/gwsocket

Support for multiple instances?

a12one opened this issue · 9 comments

Thanks for making gwsocket, it is a very cool and useful project! At the moment I understand we support 1 instance /tmp/wspipein.fifo -> terminal.html, is it possible we can support multiple instances as in we have

/tmp/wspipein-1.fifo -> terminal-1.html
/tmp/wspipein-2.fifo -> terminal-2.html
/tmp/wspipein-3.fifo -> terminal-3.html

with only have 1 gwsocket process running in the background?

Good question, currently you would need to run multiple gwsocket instances using a different pipe. I'd need to look into having the ability to run one process but multiple pipes.

By the way, I think this would be really useful for goaccess as it has been requested there as well.

it would be a great enhancement, thank you again for looking into this!

Also, may I ask if we can have the reference HTML/JS code that is demonstrated in the gif on the homepage which renders the WebSocket output perfectly? @allinurl thanks a lot!

Now, If you are looking to have your full terminal output displayed in the browser, you need to load hterm.js. You can get a copy and the example here.

Here's the index file, just press Ctrl+u to see the code.

This is somewhat related... I created a FreeBSD port that includes a rc.d script that also supports the ability to run multiple instances, configurable via .conf files. It should make it's way into the official ports tree soon.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=247884

The port can be found at: https://github.com/tuaris/freebsd-gwsocket

@tuaris Thanks for sharing that!

Date: Sat Aug 15 05:30:41 2020
New Revision: 544909

Log:
New port: www/gwsocket Simple WebSocket Server

(That's "it has now landed in FreeBSD ports")

Here's the index file, just press Ctrl+u to see the code.

Suggestion: include the terminal example in the source code.