]> 127.0.0.1 Git - bili_danmu/.git/commitdiff
Improve 可关闭web服务
authorqydysky <32743305+qydysky@users.noreply.github.com>
Sat, 11 Mar 2023 08:05:38 +0000 (16:05 +0800)
committerqydysky <32743305+qydysky@users.noreply.github.com>
Sat, 11 Mar 2023 08:05:38 +0000 (16:05 +0800)
CV/Var.go
demo/config/config_K_v.json

index 0a41dde1d2d18d5b1b0a43c60c6db810d913ea9a..12900be160ec63c13adffe604c35d1f7fc72291b 100644 (file)
--- 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)
index 58e7f6ab24ddf7d871ab62c648c3d137aee3362c..334b9b71d166371f3cd0ab4ece59d4fcf6e3c4aa 100644 (file)
@@ -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,