feat: multiple down proxy urls (close #793)

This commit is contained in:
Xhofe
2022-03-20 16:53:30 +08:00
parent 9b23d0ab29
commit 77ffb93cbe
5 changed files with 8 additions and 5 deletions

View File

@ -11,6 +11,7 @@ import (
"github.com/go-resty/resty/v2"
log "github.com/sirupsen/logrus"
"path/filepath"
"strings"
)
func Proxy(c *gin.Context) {
@ -43,7 +44,7 @@ func Proxy(c *gin.Context) {
// 中转时有中转机器使用中转机器,若携带标志位则表明不能再走中转机器了
if account.DownProxyUrl != "" && c.Query("d") != "1" {
name := utils.Base(rawPath)
link := fmt.Sprintf("%s%s?sign=%s", account.DownProxyUrl, rawPath, utils.SignWithToken(name, conf.Token))
link := fmt.Sprintf("%s%s?sign=%s", strings.Split(account.DownProxyUrl, "\n")[0], rawPath, utils.SignWithToken(name, conf.Token))
c.Redirect(302, link)
return
}