npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

huds

v2.1.5

Published

Head-Up-Display Server (HUDS)

Downloads

197

Readme

HUDS

Head-Up-Display Server (HUDS)

Abstract

HUDS is a small server providing a Web service for serving one or more HTML Single-Page Applications (SPA) which act as "Head-Up-Displays (HUD)" or "Overlays" in video production scenarios. It is specially intended to be used with OBS Studio's CEF-based Browser Source and optionally the Elgato Stream Deck remote control device and its System:Website function.

HUDS serves the static files of one or more HUD HTML5 SPAs, which render the actual HUD display in OBS. It also provides a HUDS client API to each HUD HTML5 SPA for establishing a WebSocket connection back to HUDS. Over this WebSocket connection HUDS pushes events to each HUD which were received by HUDS either via WebSocket connections or REST endpoints. The REST endpoint is intended to be used by arbitrary Web clients to send events to any HUD. Usually, this is used with the Stream Deck System:Website plugin or with curl(1) on the command-line.

HUDS itself is usually run ad-hoc and side-by-side to OBS Studio (under localhost) but also can be deployed to a dedicated server by optionally requiring authentication and delivering one or more HUDs in parallel.

Installation

Install Node.js and then install HUDS globally into your system with:

$ npm install -g huds

Usage

The Unix manual pages huds(8) (for the server CLI) and huds(3) (for the client API) provide detailed usage information.

Example

Run a minimalistic Hello World HUD with:

$ npx -p huds -p huds-hud-hello \
  huds -a 127.0.0.1 -p 9999 -d hello:@huds-hud-hello

For a more elaborated HUD check out the Training HUD. It supports performing trainings as webinars and looks like this in practice:

screenshot

Architecture

HUDS is based on a Client/Server architecture as illustrated in the following diagram:

architecture

The individual communication steps in the diagram are:

  1. HUDS reads the HUD configuration and converts its content from YAML to JSON format for embedding into the HUDS (Client) Library. See training.yaml for an example of a HUD configuration.

  2. OBS Studio's CEF-based Browser Source open the URL http://127.0.0.1:9999/<hud-id>/[#<key>=<value>,[...]]

  3. HUDS delivers the HUD SPA with all its HTML/CSS/JS files. The individual assets are served via the HUDS URLs http://127.0.0.1:9999/<hud-id>/<asset>. See Hello World HUD for an example of a simple HUD and Training HUD for an example of a more elaborated HUD.

  4. The HUD SPA (in its index.html) references the HUDS (Client) Library with: <script type="text/javascript" src="huds"></script>.

  5. HUDS delivers the HUDS (Client) Library (and its embedded HUD configuration) under virtual HUDS URL http://127.0.0.1:9999/<hud-id>/huds.

  6. The HUDS (Client) Library opens a WebSocket connection back to HUDS under the HUDS URL http://127.0.0.1:9999/<hud-id>/events.

  7. An external program (like Elgato Stream Deck's System:Website function or Node-RED's HTTP-Request or just cURL) triggers an event with a HTTP GET request under the HUDS URL http://127.0.0.1:9999/<hud-id>/event/<event-name>[?data=<event-data>]. and with a HTTP POST request under the HUDS URL http://127.0.0.1:9999/<hud-id>/event/<event-name> and with <event-data> as the payload. In both cases, <event-data> has to be a JSON string.

  8. HUDS forwards the received event to all instances of the HUD by sending out the event to all HUD SPAs over their WebSocket connections. Notice: a single HUD can be opened multiple times and then all opened instances receive the event. This is useful to run a HUD both in OBS Studio and in parallel in the browser on a control notebook in case no dedicated Elgato Streak Deck remote control device is used.

  9. Similary, even HUD SPAs are allowed to send events (to theirself or other HUDs) over their WebSocket connection. This is useful to have a central dashboard HUD which controls one or more actual video HUDs.

License

Copyright © 2020-2022 Dr. Ralf S. Engelschall (http://engelschall.com/)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.