Add Host configuration to radio endpoint

This commit is contained in:
DataHoarder 2022-09-02 09:33:45 +02:00
parent 1464004dc4
commit 07ac74ca46
Signed by: DataHoarder
SSH Key Fingerprint: SHA256:EnPQOqPpbCa7nzalCEJY2sd9iPluFIBuJu2rDFalACI
3 changed files with 5 additions and 2 deletions

View File

@ -28,7 +28,7 @@ func main() {
defer wg.Done()
server := http.Server{
Addr: fmt.Sprintf(":%d", config.Radio.Port),
Addr: fmt.Sprintf("%s:%d", config.Radio.Host, config.Radio.Port),
Handler: http.HandlerFunc(queue.HandleRadioRequest),
}
server.SetKeepAlivesEnabled(false)

View File

@ -26,6 +26,7 @@ type Config struct {
BitDepth int `toml:"bitdepth"`
} `toml:"queue"`
Radio struct {
Host string `toml:"host"`
Port int `toml:"port"`
Name string `toml:"name"`
Description string `toml:"description"`

View File

@ -71,8 +71,10 @@ replaygain=false
[radio]
#
# The port to stream actual audio on. MeteorLight will listen on localhost.
# The HTTP port to stream actual audio on.
port=8001
# The HTTP bind address to stream actual audio on.
host="127.0.0.1"
# Name of the stream.
name="my radio"
# Description of the stream.