mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-09 05:34:58 -05:00
[cfg] Add websocket_interface option
This commit is contained in:
@@ -51,6 +51,7 @@ static cfg_opt_t sec_general[] =
|
||||
CFG_INT_CB("loglevel", E_LOG, CFGF_NONE, &cb_loglevel),
|
||||
CFG_STR("admin_password", NULL, CFGF_NONE),
|
||||
CFG_INT("websocket_port", 3688, CFGF_NONE),
|
||||
CFG_STR("websocket_interface", NULL, CFGF_NONE),
|
||||
CFG_STR_LIST("trusted_networks", "{localhost,192.168,fd}", CFGF_NONE),
|
||||
CFG_BOOL("ipv6", cfg_true, CFGF_NONE),
|
||||
CFG_STR("bind_address", NULL, CFGF_NONE),
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
static struct lws_context *context;
|
||||
static pthread_t tid_websocket;
|
||||
|
||||
static const char *websocket_interface;
|
||||
static int websocket_port;
|
||||
static bool websocket_exit = false;
|
||||
|
||||
@@ -377,6 +378,7 @@ websocket_init(void)
|
||||
struct lws_context_creation_info info;
|
||||
int ret;
|
||||
|
||||
websocket_interface = cfg_getstr(cfg_getsec(cfg, "general"), "websocket_interface");
|
||||
websocket_port = cfg_getint(cfg_getsec(cfg, "general"), "websocket_port");
|
||||
|
||||
if (websocket_port <= 0)
|
||||
@@ -387,6 +389,7 @@ websocket_init(void)
|
||||
|
||||
memset(&info, 0, sizeof(info));
|
||||
info.port = websocket_port;
|
||||
info.iface = websocket_interface;
|
||||
info.protocols = protocols;
|
||||
if (!cfg_getbool(cfg_getsec(cfg, "general"), "ipv6"))
|
||||
info.options |= LWS_SERVER_OPTION_DISABLE_IPV6;
|
||||
|
||||
Reference in New Issue
Block a user