This commit is contained in:
cdle
2021-10-11 12:44:23 +08:00
parent cb4b4b7ba9
commit 0f55acc901
+14 -4
View File
@@ -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 {