allinurl / gwsocket

fast, standalone, language-agnostic WebSocket server RFC6455 compliant
http://gwsocket.io
MIT License
745 stars 67 forks source link

Support for multiple instances? #31

Open a12one opened 4 years ago

a12one commented 4 years ago

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?

allinurl commented 4 years ago

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.

allinurl commented 4 years ago

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

a12one commented 4 years ago

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!

allinurl commented 4 years ago

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.

allinurl commented 4 years ago

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

tuaris commented 4 years ago

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

allinurl commented 4 years ago

@tuaris Thanks for sharing that!

adriaandegroot commented 4 years ago

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")

tomski-spqr commented 4 weeks ago

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

Suggestion: include the terminal example in the source code.