feat: support user content download proxy & relay proxy now

This commit is contained in:
JustSong
2024-05-29 01:14:00 +08:00
parent b53e00a9b3
commit ceea4c6d4a
10 changed files with 84 additions and 38 deletions

View File

@@ -1,24 +0,0 @@
package client
import (
"github.com/songquanpeng/one-api/common/config"
"net/http"
"time"
)
var HTTPClient *http.Client
var ImpatientHTTPClient *http.Client
func init() {
if config.RelayTimeout == 0 {
HTTPClient = &http.Client{}
} else {
HTTPClient = &http.Client{
Timeout: time.Duration(config.RelayTimeout) * time.Second,
}
}
ImpatientHTTPClient = &http.Client{
Timeout: 5 * time.Second,
}
}