From 508b27210980a77988666d9813e861757b986daf Mon Sep 17 00:00:00 2001 From: qydysky Date: Fri, 13 May 2022 00:59:14 +0800 Subject: [PATCH] =?utf8?q?=E5=B0=8F=E5=BF=83=E5=BF=83=E7=AB=AF=E5=8F=A3?= =?utf8?q?=E5=8F=AF=E8=87=AA=E5=AE=9A=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- F/xinxin.go | 10 ++++++++-- demo/config/config_K_v.json | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/F/xinxin.go b/F/xinxin.go index a7ed537..37ee5fd 100644 --- a/F/xinxin.go +++ b/F/xinxin.go @@ -116,8 +116,12 @@ func server() { }) } + port := strconv.Itoa(sys.Sys().GetFreePort()) + if v, ok := c.C.K_v.LoadV(`小心心端口`).(int); ok && v != 0 { + port = strconv.Itoa(v) + } w := web.New(&http.Server{ - Addr: "127.0.0.1:" + strconv.Itoa(sys.Sys().GetFreePort()), + Addr: "0.0.0.0:" + port, }) //新建web实例 w.Handle(map[string]func(http.ResponseWriter, *http.Request){ //路径处理函数 `/`: func(w http.ResponseWriter, r *http.Request) { @@ -138,7 +142,9 @@ func server() { }) webpath = `http://` + w.Server.Addr //提示 - wslog.L(`I: `, `使用WebJs`, webpath, `进行加密`) + for _, v := range sys.GetIntranetIp(``) { + wslog.L(`I: `, `使用WebJs`, strings.ReplaceAll(webpath, "0.0.0.0", v), `进行加密`) + } } func Wasm(uid uintptr, rt RT) (so RT, o string) { //maxloop 超时重试 diff --git a/demo/config/config_K_v.json b/demo/config/config_K_v.json index d2792da..d9708c9 100644 --- a/demo/config/config_K_v.json +++ b/demo/config/config_K_v.json @@ -28,6 +28,7 @@ "save_to_json": "", "get_xiao_xinxin-help": "获取小心心", "get_xiao_xinxin": true, + "小心心端口": 0, "自动打开小心心浏览器": true, "小心心nodjs加密服务地址-help": "请查看项目README", "小心心nodjs加密服务地址": "", -- 2.39.2