HTTP API

Discuss client development (or even MPD development if you feel so inclined), ask questions about the client libs, MPD feature requests from client developers, etc...
Post Reply
perman
Posts: 2
Joined: November 30th, 2019, 2:56 pm

HTTP API

Post by perman » November 30th, 2019, 3:09 pm

Hi,
I'm going to build simple Web client for MPD written in React.js. I'd like to host it with online and communicate with MPD with HTTP (no installation required).

For that purpose, I need MPD to be able to communicate over HPPT or Websockets and I've heard something about building HTTP server in MPD but I was not able to find any documentation of that feature. The only documentation I found was about streaming music over HTTP. So I wanted to ask if it is possible to issue commands to MPD over HTTP or not and if it is possible the how.

I've already tried implementing my own server that will provide HTTP API and translate all requests to sockets with Flask and python-mpd2. Do you think this is a good approach?

Thanks for any suggestions.
MPD rocks!

max
Forum team
Posts: 958
Joined: January 15th, 2013, 3:43 pm

Re: HTTP API

Post by max » December 1st, 2019, 11:46 am

MPD has a HTTP server, but it's only there to serve streaming audio. It cannot be used to control MPD.

perman
Posts: 2
Joined: November 30th, 2019, 2:56 pm

Re: HTTP API

Post by perman » December 1st, 2019, 2:59 pm

Thanks. And do you know about something I could use to create my web client? (I feel like there had to be something like HTTP server for mpd like 3rd party package or something)
I've tried to find something but without much luck.

Thanks.

max
Forum team
Posts: 958
Joined: January 15th, 2013, 3:43 pm

Re: HTTP API

Post by max » December 1st, 2019, 3:23 pm

I don't know something. I believe every MPD web client reimplemented its own HTTP API to access MPD. Of course, that's bad - but it's just as bad as writing yet another web client.

Post Reply