Skip to main content

WebRTC broker for CADbuildr - mediates communication between foundation library and viewer

Project description

CADbuildr Broker

WebRTC broker for CADbuildr that mediates communication between Foundation and a viewer page.

Status

green

Runtime contract

The broker is local-first. Keep heavy CAD data local.

  • Data path (heavy): Foundation -> local broker /send -> WebRTC DataChannel -> viewer.
  • Signaling path (lightweight): viewer/broker offer-answer exchange via signaling API.
  • Signaling can be local or remote/authenticated.
  • The broker does not need to relay CAD DAG payloads through cloud endpoints.

Installation

From PyPI

pip install cadbuildr-broker

From monorepo (development)

cd py/packages/broker
poetry install

Usage

Start with hosted Hub signaling (default):

cadbuildr-broker

Equivalent monorepo command:

cd py/packages/broker
poetry run cadbuildr-broker

Use local signaling (Hub on localhost) by overriding defaults:

cadbuildr-broker \
  --host localhost \
  --port 3000 \
  --signaling-scheme http

Or set an explicit signaling API base URL:

cadbuildr-broker \
  --signaling-base-url https://hub.cadbuildr.com/api/webrtc

Use remote signaling with auth:

CADBUILDR_SIGNALING_BEARER_TOKEN="<token>" \
cadbuildr-broker \
  --signaling-base-url https://hub.cadbuildr.com/api/webrtc

CLI options

  • --host: signaling host (default: hub.cadbuildr.com)
  • --port: signaling port (default: 443)
  • --signaling-scheme: http or https (default: https)
  • --signaling-base-url: full signaling API base URL, for example https://hub.cadbuildr.com/api/webrtc
  • --auth-bearer-token: optional bearer token for signaling requests (or use env CADBUILDR_SIGNALING_BEARER_TOKEN)
  • --broker-port: local HTTP port used by Foundation and screenshot upload (default: 5050)

What runs where

  1. Broker polls signaling API for offers.
  2. Viewer creates WebRTC offer and receives answer.
  3. Foundation posts DAG to broker /send on localhost.
  4. Broker forwards DAG to viewer via DataChannel.
  5. Viewer posts screenshots/log payloads back to broker.

Publishing

Recommended release flow:

cd py/packages/broker
poetry build
poetry config repositories.testpypi https://test.pypi.org/legacy/
poetry publish --repository testpypi
pip install -i https://test.pypi.org/simple cadbuildr-broker
poetry publish

If your environment uses token-based publishing, configure Poetry credentials before publishing.

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

cadbuildr_broker-0.2.1.tar.gz (11.1 kB view details)

Uploaded Source

Built Distribution

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

cadbuildr_broker-0.2.1-py3-none-any.whl (13.7 kB view details)

Uploaded Python 3

File details

Details for the file cadbuildr_broker-0.2.1.tar.gz.

File metadata

  • Download URL: cadbuildr_broker-0.2.1.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/24.6.0

File hashes

Hashes for cadbuildr_broker-0.2.1.tar.gz
Algorithm Hash digest
SHA256 176b81547d279958d2e072647e8ea0f6c1e14560e325d8ef0365fd506f469463
MD5 1ca0917dc5c5dd158be9368dc9fdde47
BLAKE2b-256 7fc1b23fc9406584842b19e74fdd97c66f488c636e489bfe71476b6b1f5dd6cc

See more details on using hashes here.

File details

Details for the file cadbuildr_broker-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: cadbuildr_broker-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 13.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/24.6.0

File hashes

Hashes for cadbuildr_broker-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 51b9d37208cf703bd04c6db0a916a3a5f53025e56a040104fadea2753c9828d3
MD5 6204f562da5ffb347a93b295d5728198
BLAKE2b-256 43d96fb9ff068fc2fbec437e6ce5dc05e73c0055b5d2f4c0f1323e91feb2d1b7

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