1
0
Fork 0

🎨 逻辑优化

This commit is contained in:
李寻欢 2023-12-10 08:19:21 +08:00
parent 3bc95e1317
commit 3fbaf7aeb6
3 changed files with 8 additions and 4 deletions

View File

@ -4,7 +4,7 @@ wechat:
host: 10.0.0.73:19088
# 是否在启动的时候自动设置hook服务的回调
autoSetCallback: false
# 回调IP如果是Docker运行本参数必填如果Docker修改了映射格式为 ip:port
# 回调IP如果是Docker运行本参数必填(填auto表示自动不适用于 docker 环境)如果Docker修改了映射格式为 ip:port
callback: 10.0.0.51
# 转发到其他地址
forward:

View File

@ -16,8 +16,8 @@ wechat:
host: wechat:19088
# 是否在启动的时候自动设置hook服务的回调
autoSetCallback: true
# 回调IP如果是Docker运行本参数必填如果Docker修改了映射格式为 ip:port如果使用项目提供的docker-compsoe.yaml文件启动可以不写
callback:
# 回调IP如果是Docker运行本参数必填如果Docker修改了映射格式为 ip:port如果使用项目提供的docker-compsoe.yaml文件启动可以填`auto`
callback: auto
# 数据库
mysql:

View File

@ -29,7 +29,11 @@ func ClearCallback() {
// @param host
func SetCallback(userHost string) {
// 获取本机IP地址
host := net.ParseIP(netutil.GetInternalIp()).String()
host := userHost
if userHost == "auto" {
host = net.ParseIP(netutil.GetInternalIp()).String()
}
port := 19099
if userHost != "" {
uh := strings.Split(strings.TrimSpace(userHost), ":")