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.1.tar.gz (20.5 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.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: doom_frequency_relayer-0.1.1.tar.gz
  • Upload date:
  • Size: 20.5 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.1.tar.gz
Algorithm Hash digest
SHA256 2e98e216bd45b5761fe016b92d36e23b795de868e3c2e1054929940f455c1b33
MD5 dde461cab1708dc7a559232be2c7797e
BLAKE2b-256 503584dcde907909b43278861b6fc5d6836c579474e83f8975751df7584d4a0f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: doom_frequency_relayer-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fb1b3b08832fcf94ff9004303eefdbfe351e3f1076c33d5c535eae6705c15d0e
MD5 9dd2b2c8f14c6a443bbe36287232ff3a
BLAKE2b-256 5da5457205dd9b1e4e68951537ce0fd2ff7f3ec1cdae777ce7dda771606252ee

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