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 local signaling (Hub on localhost):

cadbuildr-broker

Equivalent monorepo command:

cd py/packages/broker
poetry run cadbuildr-broker

Use remote signaling (for example hosted Hub viewer API):

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: localhost)
  • --port: signaling port (default: 3000)
  • --signaling-scheme: http or https (default: http)
  • --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: 5000)

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 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.0.tar.gz (10.9 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.0-py3-none-any.whl (13.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cadbuildr_broker-0.2.0.tar.gz
  • Upload date:
  • Size: 10.9 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.0.tar.gz
Algorithm Hash digest
SHA256 d9c887abb78f6a6cc5325f58a76f89a5cc91e786ce284a8b5d8f38b58a0df3e9
MD5 2c7b36023383da8c013de5f33bb15dc9
BLAKE2b-256 4c5c42cbe3ce654de86abb8f5c115f9ffb54614b356e9d97648d46aa8581b081

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cadbuildr_broker-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 13.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d3091198987de52ad8009f6af8857dc330577f84b352c0239ca776e80be40880
MD5 a65f5bab863827137e5e6569a6bcb6ec
BLAKE2b-256 1eb43c8abff6014a46096fe7a8431ffd9364bcdf3fa0cf7362aac89d6c97b1d3

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