A squeezelite web-based front end
  • Ruby 64.8%
  • HTML 30.8%
  • Shell 4.4%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2026-09-26 11:29:48 +01:00
debian Fixed package generation by moving file list to sl-web.install from rules, and renamed service files to sl-web for consistency. 2026-09-26 11:05:55 +01:00
deploy Updated README with instructions for squeezelite disabling on the host, setting LMS host to different from localhost, and starting the service as that now happens on install. 2026-09-26 11:17:09 +01:00
test Add lossless FLAC streaming mode 2026-09-26 10:41:32 +01:00
views Got rid of em dashes. 2026-09-26 11:29:48 +01:00
app.rb Add lossless FLAC streaming mode 2026-09-26 10:41:32 +01:00
config.ru Build initial Lyrion web player 2026-09-24 13:03:03 +01:00
Gemfile Harden web player and refine artwork UI 2026-09-25 08:16:29 +01:00
Gemfile.lock Harden web player and refine artwork UI 2026-09-25 08:16:29 +01:00
puma.rb Harden web player and refine artwork UI 2026-09-25 08:16:29 +01:00
README.md Structural changes to README to make the difference between package and source installs clearer. 2026-09-26 11:26:23 +01:00

Lyrion Web Player

A small bridge that makes a browser appear as a normal Squeezelite player in Lyrion Media Server (LMS):

LMS -> Squeezelite -> raw 48 kHz PCM -> FFmpeg -> MP3 or FLAC over HTTPS -> browser

Each browser receives a stable player identity in an HttpOnly cookie. Opening the stream starts a dedicated Squeezelite process; closing or replacing it stops the process. Track details, cover artwork, and playback position are read from LMS, including LMS-hosted artwork for local-library tracks; the progress bar is hidden when a stream has no known duration. The play/pause control also operates the LMS player rather than pausing the browser stream. The transport controls provide previous/next track commands, while the power button connects or disconnects the browser stream. A volume slider displays and controls the LMS player volume. The default maximum of streams is eight simultaneous browsers. MP3 at 192 kbps is the default for compatibility and modest bandwidth use; FLAC mode preserves the decoded audio losslessly but commonly requires around 1 Mbps per connected browser.

Package installs

Debian / Ubuntu / Raspberry Pi OS package installation

Download the latest version of the package and then run the following, changing the version number as appropriate:

sudo apt install ./sl-web_1.0.0-1_all.deb

The package will install squeezelite if it is not already installed. You may want to do this to stop the server device registering in your Lyrion Media Server:

sudo systemctl stop squeezelite
sudo systemctl disable squeezelite

Set up web server

nginx

There is an example fragments for nginx config in /usr/share/doc/sl-web/examples. It is important that both fragments are placed in suitable places in your nginx configuration.

Authentication

The example web server configurations use a .htaccess file at /etc/nginx/.htpasswd. install and use the htpasswd command from the apache2-utils package to generate the file:

htpasswd -c /etc/nginx/.htpasswd <usernamei you want to use>

Connecting to Lyrion

By default sl-web connects to a Lyrion service running on localhost. If you want to deploy this on a different host than the one the Lyrion service is running on then you will need to change the value of LMS_HOST in /lib/systemd/system/sl-web.service to the IP or hostname of the system the Lyrion service is running on.

External access

The above will most likely just give access to the app in your internal network. To expose the application externally you will need to set up port forwarding on your edge router to port 80 on the device you are installing this on. You will then be able to access the web player by going to http://<your external ip>/player in a web browser running on any device external to your network.

I strongly recommend that you set up https access using something like Let's Encrypt.

Run source from repo locally

Ruby 3.1+, Squeezelite, and FFmpeg are required.

bundle install
bundle exec puma -C puma.rb

Open http://127.0.0.1:9393, press Connect player, then select the named Web Player in an LMS controller. Environment variables include LMS_HOST (default 127.0.0.1), LMS_PORT (default 3483), PORT (default 9393), MAX_STREAMS (default 8), LMS_HTTP_PORT (default 9000), and PUBLIC_ORIGIN (the exact external scheme and host, recommended in production).

Deploy source from repo locally

  1. Copy the project to /usr/share/squeeze-web, install its bundle, and grant the service user read/execute access. Ensure bundle is installed in the service's system PATH (/usr/local/bin, /usr/bin, or /bin).
  2. Install deploy/squeeze-web.service under /etc/systemd/system/, setting PUBLIC_ORIGIN to the public HTTPS origin.
  3. Include deploy/nginx-http.conf once in nginx's http {} block. Add deploy/nginx.conf to an HTTPS virtual host and protect /player/ with the supplied auth_basic directives, adjusting the password-file path if needed. Do not expose port 9393; the app binds to loopback by default.
  4. Reload systemd and nginx, then enable and start squeeze-web.

The example nginx location uses a /player/ prefix. The application emits relative URLs, so it also works at that prefix without application changes.

FreeBSD

Install Ruby, Bundler, Squeezelite, and FFmpeg, then place the application under /usr/local/www/squeeze-web. The supplied rc script defaults to FreeBSD's www account and /usr/local executable paths:

pkg install ruby rubygem-bundler squeezelite ffmpeg
install -m 555 deploy/squeeze_web /usr/local/etc/rc.d/squeeze_web
sysrc squeeze_web_enable=YES
sysrc squeeze_web_public_origin=https://music.example.com
service squeeze_web start

Configuration uses standard rc.conf variables. Useful settings include squeeze_web_dir, squeeze_web_user, squeeze_web_lms_host, squeeze_web_port, squeeze_web_max_streams, squeeze_web_puma_threads, and squeeze_web_public_origin. Logs default to /var/log/squeeze_web.log. The nginx configuration and security guidance above apply unchanged on FreeBSD.

Test

bundle exec ruby test/app_test.rb

This is an audio bridge with basic transport and volume controls, not a full LMS controller. Queue management and grouping remain in LMS or a normal LMS controller application.

Security

Internet deployments should use HTTPS and authentication. The application also rejects cross-origin controls, limits request and artwork sizes, caps concurrent streams, redirects remote artwork only to public HTTPS hosts, and ships nginx rate/connection limits. These controls reduce abuse but are not a substitute for authentication when exposed to untrusted users. Internet exposure requires the supplied nginx limits; Puma alone does not provide equivalent upload limits.