MPD icon indicating copy to clipboard operation
MPD copied to clipboard

Add WebSocket support

Open erdnaxe opened this issue 3 years ago • 5 comments

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.

erdnaxe avatar Apr 12 '22 19:04 erdnaxe

Any news?

jehon avatar Jan 31 '23 13:01 jehon

No. Nobody is working on that.

MaxKellermann avatar Jan 31 '23 13:01 MaxKellermann