hub-pro is a secure version of hub-lite.
- Load balancers
- Permissions
- Merge hubs
bunx v57/hub-probun i && bun .-p,--port <port>: listen on a specific port or address--merge <address>: will merge api to another Hub.--owner <id>: set owner key.--launcher <id>: sets launcher key that allowed to hostlauncher/*APIs.
HUBLISTEN: default listen address or port.HUBOWNER: owner key to trust at startup.HUBLAUNCHER: launcher key to trust at startup.
randomwill call random servicecounterwill call next service in the listfirstwill call first available service in the listavailablesame ascounter, but checks for availability
- Owners can call all Hub commands and will bypass any service permissions
- Owners can allow services to host api
- Services can provide permission for each api, so only allowed connections can use it
- Owners can create permission groups and assign keys to it
- Lockdown mode blocks any non whitelisted users to connect to Hub
import { Service } from 'hub-service'
new Service().post('hash/sha256', body => new Bun.SHA256().update(body).digest('hex')).start()import { Service } from 'hub-service'
const service = new Service().start()
const hash = await service.send('hash/sha256', 'Hello World')
console.log(hash)