cyp
1.0.0
CYP是音樂播放器守護程序MPD的基於網絡的前端。您可以使用它來控製播放,而無需安裝本機應用程序。它在台式機和移動設備的現代網絡瀏覽器中工作。


確保首先使用工作的MPD設置,並且節點版本> = 10
git clone https://github.com/ondras/cyp.git && cd cyp
npm i
node .將瀏覽器指向http:// localhost:8080以打開接口。指定自定義MPD地址:
MPD_HOST和MPD_PORT環境變量,或server Querystring參數( ?server=localhost:6655 )。 另外,您可以使用Docker運行CYP。
git clone https://github.com/ondras/cyp.git && cd cyp
docker build -t cyp .
docker run --network=host cyp如果您想運行CYP作為服務並通過Apache2代理它,則需要啟用幾個模塊。
# a2enmod proxy
# a2enmod proxy_http
# a2enmod proxy_wstunnel
# a2enmod proxypass
要在名為“音樂”(https://example.com/music/)的VIDAL文件夾中介紹CYP,將以下內容添加到您的網站配置中。
# MPD daemon
RewriteEngine on # Enable the RewriteEngine
RewriteCond %{REQUEST_FILENAME} !-f # If the requested file isn't a file
RewriteCond %{REQUEST_FILENAME} !-d # And if it isn't a directory
RewriteCond %{REQUEST_URI} .*/music$ # And if they only requested /music instead of /music/
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [QSA,L,R=301] # Then append a trailing slash
ProxyPass /music/ http://localhost:3366/ # Proxy all request to /music/ to the CYP server (running on the same server as apache)
ProxyWebsocketFallbackToProxyHttp Off # Don't fallback to http for WebSocket requests
# Rewrite WebSocket requests to CYP WebSocket requets, (also converts wss to ws)
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteCond %{HTTP:Connection} upgrade [NC]
RewriteRule ^/music/?(.*) "ws://localhost:3366/$1" [P,L]
location /music/ {
proxy_pass_header Set-Cookie;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_set_header Host $host;
proxy_pass http://localhost:8080/;
}
您將需要一個工作的YouTube-DL安裝。音頻文件將下載到_youtube目錄中,因此請確保它可用於MPD庫(使用SymLink)。
如果使用Docker,則需要將_youtube目錄掛載到圖像中:
docker run --network=host -v " $( pwd ) " /_youtube:/cyp/_youtube cyp...通過PORT環境變量完成。如果使用Docker, -e開關可以做到這一點:
docker run --network=host -e PORT=12345 cyp在CYPS主目錄中創建passwords.json文件。為可用MPD服務器指定密碼:
{
"localhost:6600" : " my-pass-1 " ,
"some.other.server.or.ip:12345" : " my-pass-2 "
}確保主機名和端口匹配通過server Querystring參數指定的(默認為localhost:6600 )。
Origin檢查更好)