krossbar-hub

Crates.iokrossbar-hub
lib.rskrossbar-hub
version0.5.5
sourcesrc
created_at2024-05-18 10:43:04.825512
updated_at2024-06-12 18:35:35.562512
descriptionKrossbar bus hub
homepagehttps://krossbar.rs
repositoryhttps://github.com/krossbar-platform/krossbar-bus
max_upload_size
id1244221
size98,458
Alexander Smoktal (alexander-smoktal)

documentation

README

Crates.io MIT licensed Build Status

krossbar-hub

Krossbar bus hub

The binary acts as a hub for service connections. On request it makes a UDS pair and sends corresponding sockets to each of the peers, which afterward use the pair for communication. The only known point of rendezvous fot the services is the hub socket.

The hub uses krossbar_bus_common::DEFAULT_HUB_SOCKET_PATH for hub socket path and krossbar_bus_common::DEFAULT_SERVICE_FILES_DIR for service files dir by default. These can be changed using cmd args.

Created socket has 0o666 file permission to allow service connections.

Service files

During service registration and later for all connection requests the hub uses permission system to check if the service is allowed to do what it's trying to do.

Service file filename identifies client service name. The file itself contains executable glob for which it's allowed to register the service, and a list of client names, who are allowed to connect to the service.

Basic service file com.example.echo.service may look like the following:

{
"exec": "/data/krossbar/*",
"incoming_connections": ["**"]
}

See lib examples directory for service files examples.

Building

Build manually or use cargo install krossbar-bus-hub to install.

Usage:

Krossbar bus hub

Usage: krossbar-bus-hub [OPTIONS]
Options:
  -l, --log-level <LOG_LEVEL>
          Log level: OFF, ERROR, WARN, INFO, DEBUG, TRACE [default: TRACE]
  -a, --additional-service-dirs <ADDITIONAL_SERVICE_DIRS>
          Additional service files directories [default: []]
  -s, --socket-path <SOCKET_PATH>
          Hub socket path [default: /var/run/krossbar.bus.socket]
  -h, --help
          Print help
  -V, --version
          Print version
Commit count: 170

cargo fmt