From: qydysky <32743305+qydysky@users.noreply.github.com> Date: Sat, 11 Mar 2023 08:05:38 +0000 (+0800) Subject: Improve 可关闭web服务 X-Git-Tag: v0.7.2~9 X-Git-Url: http://127.0.0.1:8081/?a=commitdiff_plain;h=0d1dc5817fb40fe9afe16fd91a6294f203a0b525;p=bili_danmu%2F.git Improve 可关闭web服务 --- diff --git a/CV/Var.go b/CV/Var.go index 0a41dde..12900be 100644 --- a/CV/Var.go +++ b/CV/Var.go @@ -223,14 +223,15 @@ func (t *Common) Init() Common { } }() - if serAdress, ok := t.K_v.LoadV("Web服务地址").(string); ok { + t.SerF = new(web.WebPath) + t.Stream_url = &url.URL{} + + if serAdress, ok := t.K_v.LoadV("Web服务地址").(string); ok && serAdress != "" { serUrl, e := url.Parse("http://" + serAdress) if e != nil { panic(e) } - t.SerF = new(web.WebPath) - web.NewSyncMap(&http.Server{ Addr: serUrl.Host, }, t.SerF) diff --git a/demo/config/config_K_v.json b/demo/config/config_K_v.json index 58e7f6a..334b9b7 100644 --- a/demo/config/config_K_v.json +++ b/demo/config/config_K_v.json @@ -64,6 +64,7 @@ "仅保存当前直播间流-help": "启用此项,才会保存Ass", "仅保存当前直播间流": true, "修改标题时重新录制": true, + "Web服务地址-help":"填写本程序各组件所用的服务地址 例0.0.0.0:10000 为空时不启动Web服务", "Web服务地址":"0.0.0.0:10000", "直播Web服务路径":"/web/", "直播Web可以发送弹幕":true,