Skip to content

使用 Any Listen 播放器听音乐

Web端 github: https://github.com/any-listen/any-listen

桌面端 github: https://github.com/any-listen/any-listen-desktop

Docker 安装 Web 端

Docker Hub: https://hub.docker.com/r/lyswhut/any-listen-web-server

访问:http://localhost:9500

shell
docker run \
--name anylisten \
-p 9500:9500 \
-e LOGIN_PWD=<> \
-e ALLOW_PUBLIC_DIR=/music \
--volume=/home/music:/music \
--volume=/opt/anylisten/data:/server/data \
-d lyswhut/any-listen-web-server:0.9.0-beta.16

Docker Compose 安装 Web 端

yaml
services:
  anylisten:
    image: lyswhut/any-listen-web-server:0.9.0-beta.16
    container_name: anylisten
    restart: unless-stopped
    ports:
      - "9500:9500"
    environment:
      - LOGIN_PWD=1qaz2wsx
      - ALLOW_PUBLIC_DIR=/music
    volumes:
      - /opt/anylisten/data:/server/data
      - /opt/anylisten/music:/music

参数说明

LOGIN_PWD:登录密码 ALLOW_PUBLIC_DIR:允许访问的目录

使用 Nginx 代理访问 docker 容器

conf
server {
    listen 80;
    listen  [::]:80;
    server_name music.aday.fun;
    rewrite ^(.*)$ https://$host$1 permanent;
}

server {
    listen      443 ssl;
    listen [::]:443 ssl;
    server_name  music.aday.fun;
    # 安全优化
    client_max_body_size 100M;
    ssl_certificate /etc/nginx/ssl/aday.fun.cer;
    ssl_certificate_key /etc/nginx/ssl/aday.fun.key;

    location / {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header REMOTE-HOST $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://localhost:9500/;

        # 支持 WebSocket
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
    }
}

使用桌面端

桌面端 github: https://github.com/any-listen/any-listen-desktop