Added unix socket support in HttpdOutputPlugin

This commit is contained in:
1848 2018-08-07 19:28:29 +02:00
parent 52521d02ea
commit 0c1a899fbe
3 changed files with 4 additions and 8 deletions

1
NEWS
View File

@ -34,6 +34,7 @@ ver 0.21 (not yet released)
- shout: support the Shine encoder plugin
- sndio: remove support for the broken RoarAudio sndio emulation
- osx: initial support for DSD over PCM
- httpd_output: support for unix sockets
* mixer
- sndio: new mixer plugin
* encoder

View File

@ -1705,7 +1705,7 @@ It is highly recommended to configure a fixed format, because a stream cannot sw
* - **port P**
- Binds the HTTP server to the specified port.
* - **bind_to_address ADDR**
- Binds the HTTP server to the specified address (IPv4 or IPv6). Multiple addresses in parallel are not supported.
- Binds the HTTP server to the specified address (IPv4, IPv6 or UNIX socket). Multiple addresses in parallel are not supported.
* - **encoder NAME**
- Chooses an encoder plugin. A list of encoder plugins can be found in the encoder plugin reference :ref:`encoder_plugins`.
* - **max_clients MC**

View File

@ -33,6 +33,7 @@
#include "util/Domain.hxx"
#include "util/DeleteDisposer.hxx"
#include "Log.hxx"
#include "config/Net.hxx"
#include <assert.h>
@ -58,17 +59,11 @@ HttpdOutput::HttpdOutput(EventLoop &_loop, const ConfigBlock &block)
genre = block.GetBlockValue("genre", "Set genre in config");
website = block.GetBlockValue("website", "Set website in config");
unsigned port = block.GetBlockValue("port", 8000u);
clients_max = block.GetBlockValue("max_clients", 0u);
/* set up bind_to_address */
const char *bind_to_address = block.GetBlockValue("bind_to_address");
if (bind_to_address != nullptr && strcmp(bind_to_address, "any") != 0)
AddHost(bind_to_address, port);
else
AddPort(port);
ServerSocketAddGeneric(*this, block.GetBlockValue("bind_to_address"), block.GetBlockValue("port", 8000u));
/* determine content type */
content_type = prepared_encoder->GetMimeType();