MPD
MPD copied to clipboard
Add WebSocket support
Feature request
Currently a webpage cannot communicate with MPD using its TCP socket. It would be awesome if MPD could implement WebSocket support on his TCP socket, allowing a web browser to interact with it.
Security
We don't want any random webpage to be able to interact with MPD. It may be necessary to allow the user to specify a list of allowed domains to set the Access-Control-Allow-Origin HTTP header.
It should be made clear for the user that allowing a website to access a MPD instance may leak information.
Applications
This might highly simplify the implementation of MPD web clients, removing the need of a backend.
I wrote a while ago a small JavaScript client library to interact directly with MPD socket: https://github.com/erdnaxe/bmpc/blob/main/static/js/mpd-client.js
There is also another client library by Holger Benl which seems more complete: https://github.com/hbenl/mpc-js-core
Alternative
An alternative trick would be to use a TCP<->WebSocket gateway.
Any news?
No. Nobody is working on that.