File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -583,8 +583,23 @@ func GetSurge(c *gin.Context) {
583583 c .Writer .WriteString (DecodeClash )
584584 return
585585 }
586+ var domain string
587+ if c .Request .TLS != nil {
588+ domain = "https://" + host
589+ } else {
590+ domain = "http://" + host
591+ }
592+ proto := c .Request .Header .Get ("X-Forwarded-Proto" )
593+ if proto != "" {
594+ domain = proto + "://" + host
595+ }
596+
597+ systemDomain , _ := models .GetSetting ("system_domain" )
598+ if systemDomain != "" {
599+ domain = systemDomain
600+ }
586601 // 否则就插入头部更新信息
587- interval := fmt .Sprintf ("#!MANAGED-CONFIG %s interval=86400 strict=false" , host + url )
602+ interval := fmt .Sprintf ("#!MANAGED-CONFIG %s interval=86400 strict=false" , domain + url )
588603 // 执行脚本
589604 for _ , script := range sub .ScriptsWithSort {
590605 res , err := utils .RunScript (script .Content , DecodeClash , "surge" )
You can’t perform that action at this time.
0 commit comments