Files
claude-relay-service/.env.example
shaw a45c832278 feat: 统一代理配置管理,支持IPv4/IPv6协议族选择
- 新增统一代理工具 ProxyHelper,支持 SOCKS5/HTTP/HTTPS 代理
- 添加 IPv4/IPv6 协议族配置选项,默认使用 IPv4 确保兼容性
- 移除 OpenAI 路由中硬编码的 family: 4 限制
- 统一 8 个服务文件中的代理创建逻辑,避免重复维护
- 支持 OAuth 和 token 交换过程中的代理使用
- 新增配置项:PROXY_USE_IPV4(默认 true)
- 向后兼容:现有配置无需手动更新

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-20 22:36:34 +08:00

69 lines
1.7 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 🚀 Claude Relay Service Configuration
# 🌐 服务器配置
PORT=3000
HOST=0.0.0.0
NODE_ENV=production
# 🔐 安全配置
JWT_SECRET=your-jwt-secret-here
ADMIN_SESSION_TIMEOUT=86400000
API_KEY_PREFIX=cr_
ENCRYPTION_KEY=your-encryption-key-here
# 👤 管理员凭据(可选,不设置则自动生成)
# ADMIN_USERNAME=cr_admin_custom
# ADMIN_PASSWORD=your-secure-password
# 📊 Redis 配置
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_PASSWORD=
REDIS_DB=0
REDIS_ENABLE_TLS=
# 🎯 Claude API 配置
CLAUDE_API_URL=https://api.anthropic.com/v1/messages
CLAUDE_API_VERSION=2023-06-01
CLAUDE_BETA_HEADER=claude-code-20250219,oauth-2025-04-20,interleaved-thinking-2025-05-14,fine-grained-tool-streaming-2025-05-14
# 🌐 代理配置
DEFAULT_PROXY_TIMEOUT=60000
MAX_PROXY_RETRIES=3
# IP协议族配置true=IPv4, false=IPv6, 默认IPv4兼容性更好
PROXY_USE_IPV4=true
# 📈 使用限制
DEFAULT_TOKEN_LIMIT=1000000
# 📝 日志配置
LOG_LEVEL=info
LOG_MAX_SIZE=10m
LOG_MAX_FILES=5
# 🔧 系统配置
CLEANUP_INTERVAL=3600000
TOKEN_USAGE_RETENTION=2592000000
HEALTH_CHECK_INTERVAL=60000
SYSTEM_TIMEZONE=Asia/Shanghai
TIMEZONE_OFFSET=8
METRICS_WINDOW=5 # 实时指标统计窗口分钟可选1-60默认5分钟
# 🎨 Web 界面配置
WEB_TITLE=Claude Relay Service
WEB_DESCRIPTION=Multi-account Claude API relay service with beautiful management interface
WEB_LOGO_URL=/assets/logo.png
# 🛠️ 开发配置
DEBUG=false
ENABLE_CORS=true
TRUST_PROXY=true
# 🔒 客户端限制(可选)
# ALLOW_CUSTOM_CLIENTS=false
# 📢 Webhook 通知配置
WEBHOOK_ENABLED=true
WEBHOOK_URLS=https://your-webhook-url.com/notify,https://backup-webhook.com/notify
WEBHOOK_TIMEOUT=10000
WEBHOOK_RETRIES=3