Menu

weird p2p

P2P apps: signaling, relay, TURN and an offline mailbox for your apps.

weird p2p [flags]

P2P apps: signaling, a relay, TURN and an offline mailbox for browser and device apps that talk peer to peer, under <name>.<p2p domain> and your own hostnames.

weird p2p create chat --origin https://chat.example.ro    a new app (bills hourly)
weird p2p list                                            your apps
weird p2p update chat --add-origin https://beta.example.ro --mailbox on
weird p2p domains attach chat rtc.example.ro
weird p2p turn chat                                       TURN credentials for a client
weird p2p mailbox send chat room-1 note.txt               deposit for a peer that is offline
weird p2p mailbox receive chat room-1                     replay a room
weird p2p protocol                                        the protocol apps are built against

An app bills by the hour while it exists (weird credits charges).

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Subcommands: create, delete, domains, get, list, mailbox, protocol, turn, update.

weird p2p create#

Create a p2p app (bills by the hour while it exists).

weird p2p create <name> [flags]

Creates an app answering on <name>.<p2p domain>. The name is a DNS label (a-z, 0-9 and inner hyphens).

weird p2p create chat --origin https://chat.example.ro --origin "*.example.ro"
weird p2p create notes --mailbox --setting mailbox_ttl_hours=48

Without --origin any web origin may connect. Settings are the app's limits (positive numbers, held under their ceilings).

Cost, in credits (every credit charge is in weird credits charges): recurring.p2p-app-hourly per_hour, taken every hour while it exists; recurring.p2p-app-hourly per_mb_hour_cached × the mailbox's cached MB, taken every hour while it exists; p2p.relay-traffic per_mb_relayed, taken for what is used; p2p.mailbox-traffic per_mb_served_mailbox, taken for what is used. You are shown the credits it takes and asked first.

FlagTypeDefaultMeaning
--mailboxboolturn the offline mailbox on
--originstringArraya web origin allowed to connect (repeat; *.domain wildcards; none: any origin)
--settingstringArraya limit as key=number (repeat), e.g. max_room_peers=50 or mailbox_ttl_hours=48

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Calls: createP2pApp.

weird p2p delete#

Delete an app — its hourly billing stops (cannot be undone).

weird p2p delete <app> [flags]

Also: weird p2p rm.

Delete an app — its hourly billing stops (cannot be undone).

Cost, in credits (every credit charge is in weird credits charges): p2p.reads per_request per successful request. A refused or failed call is free of the per-request charges.

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Calls: listP2pApps, deleteP2pApp.

weird p2p domains#

An app's own hostnames (and attach, verify, detach).

weird p2p domains <app> [flags]

An app's own hostnames (and attach, verify, detach).

Cost, in credits (every credit charge is in weird credits charges): p2p.reads per_request per successful request. A refused or failed call is free of the per-request charges.

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Calls: listP2pApps, listP2pAppDomains.

Subcommands: attach, detach, verify.

weird p2p domains attach#

Add one of your hostnames to an app.

weird p2p domains attach <app> <hostname> [flags]

Add one of your hostnames to an app.

Cost, in credits (every credit charge is in weird credits charges): p2p.reads per_request per successful request. A refused or failed call is free of the per-request charges.

FlagTypeDefaultMeaning
--wildcardboola wildcard hostname (its zone must be hosted with weird)

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Calls: listP2pApps, attachP2pAppDomain.

weird p2p domains detach#

Remove a hostname from an app.

weird p2p domains detach <app> <hostname|id> [flags]

Remove a hostname from an app.

Cost, in credits (every credit charge is in weird credits charges): p2p.reads per_request per successful request. A refused or failed call is free of the per-request charges.

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Calls: listP2pApps, listP2pAppDomains, detachP2pAppDomain.

weird p2p domains verify#

Check an app hostname's DNS now.

weird p2p domains verify <app> <hostname|id> [flags]

Check an app hostname's DNS now.

Cost, in credits (every credit charge is in weird credits charges): p2p.reads per_request per successful request. A refused or failed call is free of the per-request charges.

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Calls: listP2pApps, listP2pAppDomains, verifyP2pAppDomainDns.

weird p2p get#

One app: its addresses, origins, settings and billing.

weird p2p get <app> [flags]

One app: its addresses, origins, settings and billing.

Cost, in credits (every credit charge is in weird credits charges): p2p.reads per_request per successful request. A refused or failed call is free of the per-request charges.

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Calls: listP2pApps, getP2pApp.

weird p2p list#

Your p2p apps.

weird p2p list [flags]

Also: weird p2p apps, weird p2p ls.

Your p2p apps.

Cost, in credits (every credit charge is in weird credits charges): p2p.reads per_request per successful request. A refused or failed call is free of the per-request charges.

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Calls: listP2pApps.

weird p2p mailbox#

An app's offline mailbox: tokens, deposit, replay.

weird p2p mailbox [flags]

The offline mailbox keeps encrypted payloads per room for peers that come online later (turn it on with weird p2p update <app> --mailbox on).

weird p2p mailbox token chat --room room-1     a token for a client (printed once)
weird p2p mailbox send chat room-1 note.bin    deposit a file (- reads stdin)
weird p2p mailbox send chat room-1 --text hi
weird p2p mailbox receive chat room-1 --after <seq>

Encrypt payloads before depositing them: the node stores exactly the bytes sent. Cached bytes and the bytes served are billed per MB.

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Subcommands: receive, send, token.

weird p2p mailbox receive#

Replay a room's messages.

weird p2p mailbox receive <app> <room> [flags]

Replay a room's messages.

Cost, in credits (every credit charge is in weird credits charges): p2p.reads per_request per successful request. A refused or failed call is free of the per-request charges.

FlagTypeDefaultMeaning
--afterstringreplay forward from this seq
--beforestringscroll back from this seq
--limitint0at most this many (default 100)

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Calls: listP2pApps, mintP2pMailboxCredentials.

weird p2p mailbox send#

Deposit a payload in a room.

weird p2p mailbox send <app> <room> [file|-] [flags]

Deposit a payload in a room.

Cost, in credits (every credit charge is in weird credits charges): p2p.reads per_request per successful request. A refused or failed call is free of the per-request charges.

FlagTypeDefaultMeaning
--textstringdeposit this text

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Calls: listP2pApps, mintP2pMailboxCredentials.

weird p2p mailbox token#

Mint a mailbox token for one of the app's clients (printed once).

weird p2p mailbox token <app> [flags]

Mint a mailbox token for one of the app's clients (printed once).

Cost, in credits (every credit charge is in weird credits charges): p2p.reads per_request per successful request. A refused or failed call is free of the per-request charges.

FlagTypeDefaultMeaning
--roomstringonly this room (default: every room of the app)
--ttlint0lifetime in seconds (default 1 hour, at most 24 hours)

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Calls: listP2pApps, mintP2pMailboxCredentials.

weird p2p protocol#

The signaling, relay, TURN and mailbox protocol apps are built against.

weird p2p protocol [flags]

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

weird p2p turn#

Mint short-lived TURN credentials for one of the app's clients.

weird p2p turn <app> [flags]

Mints TURN credentials (username, credential, addresses) for a client of the app; they expire after --ttl seconds (default and maximum: weird's TURN lifetime). They are printed once; give them to the client.

Cost, in credits (every credit charge is in weird credits charges): p2p.reads per_request per successful request. A refused or failed call is free of the per-request charges.

FlagTypeDefaultMeaning
--ttlint0lifetime in seconds

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Calls: listP2pApps, mintP2pTurnCredentials.

weird p2p update#

Change an app's origins, relay, mailbox or settings.

weird p2p update <app> [flags]

Changes an app. Origins and settings are replaced whole by the API; this command reads the current ones first, so --add-origin, --remove-origin, --setting and --unset change only what they name.

weird p2p update chat --add-origin https://beta.example.ro
weird p2p update chat --origin https://chat.example.ro      exactly this list
weird p2p update chat --clear-origins                       any origin
weird p2p update chat --relay off --mailbox on --open-mint off
weird p2p update chat --setting mailbox_ttl_hours=72 --unset mailbox_max_mb

Cost, in credits (every credit charge is in weird credits charges): p2p.reads per_request per successful request. A refused or failed call is free of the per-request charges.

FlagTypeDefaultMeaning
--add-originstringArrayadd an origin (repeat)
--clear-originsboolno origin list: any origin may connect
--mailboxstringthe offline mailbox on or off
--open-mintstringbrowsers may mint mailbox tokens themselves: on or off
--originstringArrayreplace the origins with exactly these (repeat)
--relaystringthe relay on or off
--remove-originstringArrayremove an origin (repeat)
--settingstringArrayset a limit as key=number (repeat), e.g. mailbox_max_mb=100
--unsetstringArraydrop a limit back to its default (repeat)

Global flags: --api-key, --idempotency-key, --json, --lang, --no-input, --quiet, --yes.

Calls: listP2pApps, updateP2pApp.

This page is generated from the weird CLI; it changes when the CLI does.