diff --git a/tools/ip.go b/tools/ip.go index bedadca..17998ee 100644 --- a/tools/ip.go +++ b/tools/ip.go @@ -62,3 +62,6 @@ func getIpFromAddr(addr net.Addr) net.IP { return ip } +func GetExternalIp() string { + return Get("http://myexternalip.com/raw") +} diff --git a/ws/ws.go b/ws/ws.go index 2fafacc..b6a83ce 100644 --- a/ws/ws.go +++ b/ws/ws.go @@ -80,7 +80,8 @@ func SendServerJiang(title string, content string, domain string) string { } func SendFlyServerJiang(title string, content string, domain string) string { sendStr := fmt.Sprintf("%s%s", title, content) - desp := content + ",域名:" + domain + ip := tools.GetExternalIp() + desp := content + ",内网:" + domain + ",外网:" + ip url := "https://sc.ftqq.com/SCU113707T98a3ef409d8a018c98ee7abe3278a7155f5f49e886742.send?text=" + sendStr + "&desp=" + desp //log.Println(url) res := tools.Get(url)