diff --git a/im/wx/init.go b/im/wx/init.go index beb4eb4..9c7edec 100644 --- a/im/wx/init.go +++ b/im/wx/init.go @@ -161,13 +161,23 @@ func init() { } var myip = "" +var relaier = wx.Get("relaier") func relay(url string) string { - ip, _ := httplib.Get("https://imdraw.com/ip").String() - if ip != "" { - myip = ip + if wx.GetBool("relay_mode", false) == false { + return url + } + if relaier != "" { + return fmt.Sprintf(relaier, url) + } else { + if myip == "" || wx.GetBool("dynamic_ip", false) == true { + ip, _ := httplib.Get("https://imdraw.com/ip").String() + if ip != "" { + myip = ip + } + } + return fmt.Sprintf("http://%s:%s/relay?url=%s", myip, wx.Get("relay_port", core.Bucket("sillyGirl").Get("port")), url) //"8002" } - return fmt.Sprintf("http://%s:%s/relay?url=%s", myip, wx.Get("relay_port", "8002"), url) } type Sender struct {