This application maps the MPD socket to a websocket in order to communicate with MPD in HTML5.
- Clone this repository
- Run
composer install
inside the directory - Copy the .env-example to .env and enter the necessary information
- Run
php app.php mpdProxy
- You're now be able to connect to the websocket
All the communication takes place in JSON. You must provide all the fields in the request in order to handle it. In order to keep track of incoming messages you can use the callback variable. It will be copied to the response.
The MPD commands can be found on http://www.musicpd.org/doc/protocol
{
"type": "mpdCommand",
"command": "currentsong",
"callback": "currentsongCallback"
}
{
"value": "Artist: Llwellyn\nAlbumArtist: Llewellyn\nTitle: Hunter's Moon (The Wild Hunt)\nAlbum: Moonlore\nTrack: 9...",
"callback": "currentsongCallback"
}