From 0d1dc5817fb40fe9afe16fd91a6294f203a0b525 Mon Sep 17 00:00:00 2001 From: qydysky <32743305+qydysky@users.noreply.github.com> Date: Sat, 11 Mar 2023 16:05:38 +0800 Subject: [PATCH] =?utf8?q?Improve=20=E5=8F=AF=E5=85=B3=E9=97=ADweb?= =?utf8?q?=E6=9C=8D=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- CV/Var.go | 7 ++++--- demo/config/config_K_v.json | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) 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, -- 2.39.2