Skip to main content

DoomFrequency communication relayer

Project description

doom-frequency-relayer

Bridges a local directory to the DoomFrequency WebSocket service.

  • Tails an output file and forwards every new line to wss://ws.doomfrequency.fm
  • Receives messages from the WebSocket and appends them to a dispatch file
  • Authenticates via API key → JWT (24h expiry, refreshed on every reconnect)
  • Reconnects automatically on connection loss

How it works

[external app]                  [doom-frequency-relayer]            [DoomFrequency]
  writes line  →  output file  →  tail_file  →  send_lines  →→→  wss://ws.doomfrequency.fm
                dispatch file  ←  send_lines  ←←←←←←←←←←←←←←←  incoming messages

Write to output with a trailing newline. The relayer picks up new lines as they appear and sends each one as a WebSocket message. Incoming messages are appended to dispatch, respecting a lock file (see below).

Lock file

Before writing to dispatch, the relayer checks for a lock file in the same directory. If lock exists and its contents are 1, the write is deferred by 500 ms and retried until the lock is clear. This allows external processes to safely read dispatch without racing the relayer.

Requirements

Setup

just install
cp .env.example .env
# edit .env and set DOOMFREQUENCY_API_KEY

Running

just run              # watches ../common/output, connects to wss://ws.doomfrequency.fm
just run /path/to/dir # watches a custom directory

Local testing

Start a local echo server in one terminal:

just mock

Then run the relayer without JWT in another:

just run-local

CLI reference

doom-frequency-relayer [directory] [--url URL] [--skip-jwt] [--log-level LEVEL]

  directory     Directory containing the output/dispatch/lock files.
                Defaults to <package_dir>/../common.

  --url         WebSocket URL to connect to.
                Defaults to wss://ws.doomfrequency.fm.

  --skip-jwt    Skip API key lookup and JWT authentication.
                Intended for local testing.

  --log-level   Logging verbosity: DEBUG, INFO, WARNING, ERROR. Default: INFO.

Environment

Variable Description
DOOMFREQUENCY_API_KEY API key used to obtain a JWT token.

Loaded automatically from .env if present.

Development

just test     # run tests
just lint     # ruff check
just fmt      # ruff format
just check    # lint + format check (CI)
just build    # build wheel and sdist

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

doom_frequency_relayer-0.1.0.tar.gz (20.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

doom_frequency_relayer-0.1.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file doom_frequency_relayer-0.1.0.tar.gz.

File metadata

  • Download URL: doom_frequency_relayer-0.1.0.tar.gz
  • Upload date:
  • Size: 20.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for doom_frequency_relayer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 21785d53ea78ca428ed64cf7e9a482dd100c34986a3bce5d6865282ae5fcc6b3
MD5 4121e6df9e63de1abdffbc2556dad3a1
BLAKE2b-256 792dfc75efbf451b58521cf4a9b9907017fa226923a91e7345193d2dde86ab6e

See more details on using hashes here.

File details

Details for the file doom_frequency_relayer-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: doom_frequency_relayer-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.3 {"installer":{"name":"uv","version":"0.11.3","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for doom_frequency_relayer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 27a60b69d861cec3d47caffdf21f95dc2e5cd524e8e5cce70744c30165431e11
MD5 39e89d32d64255902cdc0ed6f0e65654
BLAKE2b-256 3ba584cc4d79140c05d71fad9b717a74d7f023d08bcb1a5937916f7038a4c802

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page