Mopidy-HTTP is an extension that lets you control Mopidy through HTTP and WebSockets, for example from a web client. It is bundled with Mopidy and enabled by default.
When it is enabled it starts a web server at the port specified by the
http/port config value.
As a simple security measure, the web server is by default only available
from localhost. To make it available from other computers, change the
http/hostname config value. Before you do so, note that the HTTP
extension does not feature any form of user authentication or
authorization. Anyone able to access the web server can use the full core
API of Mopidy. Thus, you probably only want to make the web server
available from your local network or place it behind a web proxy which
takes care or user authentication. You have been warned.
Hosting web clients¶
See Configuration for general help on configuring Mopidy.
[http] enabled = true hostname = 127.0.0.1 port = 6680 static_dir = zeroconf = Mopidy HTTP server on $hostname
If the HTTP extension should be enabled or not.
Which address the HTTP server should bind to.
- Listens only on the IPv4 loopback interface
- Listens only on the IPv6 loopback interface
- Listens on all IPv4 interfaces
- Listens on all interfaces, both IPv4 and IPv6
Which TCP port the HTTP server should listen to.
Which directory the HTTP server should serve at “/”
This config value isn’t deprecated yet, but you’re strongly encouraged to make Mopidy extensions which use the the HTTP server side API to host static files on Mopidy’s web server instead of using
http/static_dir. That way, installation of your web client will be a lot easier for your end users, and multiple web clients can easily share the same web server.
Name of the HTTP service when published through Zeroconf. The variables
$portcan be used in the name.
If set, the Zeroconf services
_mopidy-http._tcpwill be published.
Set to an empty string to disable Zeroconf for HTTP.