Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/cargo/webpki-0.22.4
Browse files Browse the repository at this point in the history
  • Loading branch information
kixelated authored Oct 12, 2023
2 parents 00eeb8b + c95bb82 commit d366bf3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ This repository contains a few crates:
- **moq-transport**: An async implementation of the underlying MoQ protocol.
- **moq-api**: A HTTP API server that stores the origin for each broadcast, backed by redis.

There's currently no way to view media with `moq-rs`; you'll need to use [moq-js](https://github.com/kixelated/moq-js) for that.
There's currently no way to view media with this repo; you'll need to use [moq-js](https://github.com/kixelated/moq-js) for that.

## Development

See the [dev/README.md] helper scripts for local development.
Use the [dev helper scripts](dev/README.md) for local development.

## Usage

### moq-relay

**moq-relay** is a server that forwards subscriptions from publishers to subscribers, caching and deduplicating along the way.
It's designed to be run in a datacenter, relaying media across multiple hops to deduplicate and improve QoS.
The relays register themselves via the [moq-api] endpoints, which is used to discover other relays and share broadcasts.
The relays register themselves via the [moq-api](moq-api) endpoints, which is used to discover other relays and share broadcasts.

Notable arguments:

- `--listen <ADDR>` Listen on this address [default: [::]:4443]
- `--listen <ADDR>` Listen on this address, default: `[::]:4443`
- `--cert <CERT>` Use the certificate file at this path
- `--key <KEY>` Use the private key at this path
- `--fingerprint` Listen via HTTPS as well, serving the `/fingerprint` of the self-signed certificate. (dev only)
Expand All @@ -43,23 +43,22 @@ This can be combined with ffmpeg (and other tools) to produce a live stream.

Notable arguments:

- `<URL>` connect to the given address, which must start with https:// for WebTransport.
- `<URL>` connect to the given address, which must start with `https://` for WebTransport.

**NOTE**: We're very particular about the fMP4 ingested. See [dev/pub] for the required ffmpeg flags.
**NOTE**: We're very particular about the fMP4 ingested. See [this script](dev/pub) for the required ffmpeg flags.

### moq-transport

A media-agnostic library used by [moq-relay] and [moq-pub] to serve the underlying subscriptions.
A media-agnostic library used by [moq-relay](moq-relay) and [moq-pub](moq-pub) to serve the underlying subscriptions.
It has caching/deduplication built-in, so your application is oblivious to the number of connections under the hood.
Somebody build a non-media application using this library and I'll link it here!

See the published [crate](https://crates.io/crates/moq-transport) and [documentation](https://docs.rs/moq-transport/latest/moq_transport/).

### moq-api

This is a API server that exposes a REST API.
It's used by relays to inserts themselves as origins when publishing, and to find the origin when subscribing.
It's basically just a thin wrapper around redis.
It's basically just a thin wrapper around redis that is only needed to run multiple relays in a (simple) cluster.

## License

Expand Down
13 changes: 11 additions & 2 deletions dev/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# dev
# Local Development

This is a collection of helpful scripts for local development ONLY.
This is a collection of helpful scripts for local development.

## Setup

Expand Down Expand Up @@ -70,6 +70,10 @@ This listens for WebTransport connections on WebTransport `https://localhost:444
./dev/relay
```

It will print out a URL when you can use to publish. Alternatively, you can use `dev/pub` instead.

> Publish URL: https://quic.video/publish/?server=localhost:4443
### moq-pub

The following command runs a development instance, broadcasing `dev/source.mp4` to WebTransport `https://localhost:4443`:
Expand All @@ -78,6 +82,11 @@ The following command runs a development instance, broadcasing `dev/source.mp4`
./dev/pub
```

It will print out a URL when you can use to watch.
This will contain a random broadcast name so the below link won't work:

> Watch URL: https://quic.video/watch/REPLACE_WITH_NAME?server=localhost:4443
### moq-api

The following commands runs an API server, listening for HTTP requests on `http://localhost:4442` by default.
Expand Down
4 changes: 2 additions & 2 deletions dev/relay
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ ARGS=""

# Connect to the given URL to get origins.
# TODO default to a public instance?
if [ -n "$API" ]; then
if [ -n "${API-}" ]; then
ARGS="$ARGS --api $API"
fi

# Provide our node URL when registering origins.
if [ -n "$NODE" ]; then
if [ -n "${NODE-}" ]; then
ARGS="$ARGS --node $NODE"
fi

Expand Down

0 comments on commit d366bf3

Please sign in to comment.