Skip to content

User Hosted Secure Transmission signalling server in NodeJS

License

Notifications You must be signed in to change notification settings

dimitrovs/uhst-server-node

 
 

Repository files navigation

Star Topology

uhst-server-node

npm version license Travis Build npm total downloads Gitter

User Hosted Secure Transmission server in NodeJS



📦 Installation & Usage

Install it via the npm registry:

npm install -g uhst-server

Usage:

You can start the Express.js server with:

./uhst

By default it listens on all interfaces and port 3000 (http://0.0.0.0:3000). You can specify host and port by setting the environment variables host and port:

HOST=127.0.0.1 PORT=80 uhst

Set the environment variable JWT_SECRET to specify a HS256 secret to use for signing the tokens. This is useful for example when restarting the relay if you want to ensure existing tokens are still valid. If this variable is not set a random secret will be generated at runtime.

Note: Set UHST_PUBLIC_RELAY=true and the relay will register with the UHST public relays directory the first time it receives a ?action=host POST request without hostId specified.
The relay will be assigned a prefix and all UHST users who use this prefix as part of their hostId will connect to this relay. However, there is no authentication so every UHST relay is currently "open" by default. Thus, UHST_PUBLIC_RELAY flag controls only the advertisement of this relay, even with UHST_PUBLIC_RELAY=false any UHST user can manually connect to this relay. Only HTTPS-accessible relays can be registered in the directory.

UHST_PUBLIC_RELAY=true uhst

Analytics:

UHST Relay supports Google Analytics 4 Measurement Protocol. The goal is to keep track of how the relay is used and plan for scaling / adding new instances. Read more about GA4 Measurement Protocol here. To enable analytics, set the following environment variables:

GA_API_SECRET= An API SECRET generated in the Google Analytics UI.
GA_MEASUREMENT_ID= The measurement ID associated with a stream. Found in the Google Analytics UI.

The relay will generate a ga_client_id for every connection it receives and will store it in the JWT tokens (as gaClientId). This identifier is used for tracking subsequent requests by the same client/host.

About

User Hosted Secure Transmission signalling server in NodeJS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 99.9%
  • JavaScript 0.1%