This commit is contained in:
cdle
2021-10-11 12:44:23 +08:00
parent cb4b4b7ba9
commit 0f55acc901
+11 -1
View File
@@ -161,13 +161,23 @@ func init() {
} }
var myip = "" var myip = ""
var relaier = wx.Get("relaier")
func relay(url string) string { func relay(url string) string {
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() ip, _ := httplib.Get("https://imdraw.com/ip").String()
if ip != "" { if ip != "" {
myip = ip myip = ip
} }
return fmt.Sprintf("http://%s:%s/relay?url=%s", myip, wx.Get("relay_port", "8002"), url) }
return fmt.Sprintf("http://%s:%s/relay?url=%s", myip, wx.Get("relay_port", core.Bucket("sillyGirl").Get("port")), url) //"8002"
}
} }
type Sender struct { type Sender struct {