btw: MoQ is under active development. The APIs and protocols are still evolving and will change. Most of this documentation is AI generated until things get more stable.

Skip to content

moq

The Go module for Media over QUIC.

A thin wrapper around the UniFFI-generated bindings, exposing the same MoqClient, MoqSession, MoqBroadcastProducer, etc. types as the Python, Kotlin, and Swift packages.

Install

bash
go get github.com/moq-dev/moq-go@v0.2.11
go
import "github.com/moq-dev/moq-go/moq"

The module bundles prebuilt libmoq_ffi.a for linux/amd64, linux/arm64, darwin/amd64, darwin/arm64, and windows/amd64. cgo selects the right archive at link time via build tags.

Error handling

A server can reject the connection on auth grounds: ErrMoqErrorUnauthorized (HTTP 401) or ErrMoqErrorForbidden (HTTP 403). These are terminal: retrying without new credentials won't help, so handle them separately from a transient transport failure. The moq.IsAuthError helper catches both:

go
session, err := client.Connect("https://relay.example.com")
if moq.IsAuthError(err) {
    // Prompt for credentials; don't reconnect.
}

Local development

The in-tree go/ directory is the source skeleton; it's not a buildable Go module on its own (the generated moq.go and per-platform .a files are added at release time by CI, not committed). To exercise it locally:

bash
just go check

This runs go/scripts/check.sh, which builds moq-ffi for the host arch, regenerates the bindings with uniffi-bindgen-go, stages everything into the workspace's dist/ working dir, and runs go vet/go build/go test from the staged copy. Requires cargo, go, and uniffi-bindgen-go on the path. Install the latter once:

bash
cargo install uniffi-bindgen-go \
    --git https://github.com/NordSecurity/uniffi-bindgen-go \
    --tag v0.7.1+v0.31.0

See also

Licensed under MIT or Apache-2.0