update
This commit is contained in:
+14
-4
@@ -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 {
|
||||||
ip, _ := httplib.Get("https://imdraw.com/ip").String()
|
if wx.GetBool("relay_mode", false) == false {
|
||||||
if ip != "" {
|
return url
|
||||||
myip = ip
|
}
|
||||||
|
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 {
|
type Sender struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user