Skip to content

resonix-dev/riva-server

Riva Server

Riva Server is a Go HTTP service that provides media metadata and stream proxy endpoints for YouTube and SoundCloud.

Features

  • YouTube metadata endpoint
  • YouTube streaming proxy endpoint
  • SoundCloud streaming proxy endpoint
  • Optional shared-token access protection for provider routes
  • Configurable cache duration, concurrency, and log level

Requirements

  • Go 1.26+

Quick Start

  1. Clone the repository.
  2. Copy .env.example to .env and adjust values as needed.
  3. Run:
go run ./cmd

The server listens on RIVA_PORT (default 8080).

Configuration

Environment variables:

  • RIVA_PORT (default: 8080)
  • RIVA_LOG_LEVEL (default: info)
  • RIVA_CLIENT_TYPE (default: ANDROID; allowed: WEB, ANDROID, IOS)
  • RIVA_CACHE_DURATION (default: 5m)
  • RIVA_MAX_CONCURRENT (default: 32)
  • RIVA_ACCESS_SECRET (optional; enables auth if set)

Auth behavior for /providers/* routes when RIVA_ACCESS_SECRET is set:

  • Authorization: Bearer <secret>
  • X-API-Key: <secret> (also X-Riva-Key, X-Riva-Token)
  • Query string keys: api_key, apikey, token, secret (NOTE: query param auth is less secure and generally not recommended)

API Endpoints

Public:

  • GET /health

Protected (if RIVA_ACCESS_SECRET is configured):

  • GET /providers/youtube/{id}/info
  • GET /providers/youtube/{id}/stream/{itag}
  • GET /providers/soundcloud/stream?url=<track_url>

Development

Run tests:

go test ./...

Build locally:

go build -o riva-server ./cmd

See docs/README.md for minimal server docs.

Contributing

Please read CONTRIBUTING.md, CODE_OF_CONDUCT.md, and SECURITY.md.

License

Licensed under the terms in LICENSE.

About

Private stream-forward server for the Riva crate

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

 

Contributors

Languages