Skip to content

rokybeast/spnproxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spotify Now Playing Proxy

A secure, high-performance Rust proxy server for the Spotify Web API. Exposes current playback state via REST endpoints with built-in security, rate limiting, and token caching.

Features

  • Token caching with automatic refresh
  • Per-IP rate limiting (configurable RPM)
  • Multi-origin CORS via environment variable
  • Security headers (HSTS, X-Frame-Options, XSS protection, nosniff)
  • Structured logging with tracing
  • Health check endpoint for monitoring
  • Shields.io badge endpoint

Setup

cp .env.example .env
# Fill in your Spotify credentials

Environment Variables

Variable Required Default Description
SPOTIFY_CLIENT_ID Yes Spotify OAuth client ID
SPOTIFY_CLIENT_SECRET Yes Spotify OAuth client secret
SPOTIFY_REFRESH_TOKEN Yes Spotify OAuth refresh token
ALLOWED_ORIGINS No * (any) Comma-separated allowed CORS origins
PORT No 3000 Server port
RATE_LIMIT_RPM No 60 Max requests per minute per IP
RUST_LOG No Log level filter (e.g. info, debug)

Endpoints

GET /nowplaying

Returns current Spotify playback state.

GET /badge

Returns shields.io endpoint badge JSON.

GET /health

Returns {"status": "ok"} for uptime monitoring.

Run

cargo run

Build (Release)

cargo build --release

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages