支持添加多个 ChatGPT API 代理地址

This commit is contained in:
RockYang
2023-03-26 21:10:40 +08:00
parent fe91b0f784
commit 6a38de7eaa
6 changed files with 99 additions and 21 deletions

View File

@@ -12,7 +12,7 @@ import (
type Config struct {
Listen string
Session Session
ProxyURL string
ProxyURL []string
Chat Chat
EnableAuth bool // 是否开启鉴权
Tokens []string // 授权的白名单列表 TODO: 后期要存储到 LevelDB 或者 Mysql 数据库
@@ -43,7 +43,8 @@ type Session struct {
func NewDefaultConfig() *Config {
return &Config{
Listen: "0.0.0.0:5678",
Listen: "0.0.0.0:5678",
ProxyURL: make([]string, 0),
Session: Session{
SecretKey: utils.RandString(64),