-
Notifications
You must be signed in to change notification settings - Fork 87
feat: 为 AnthropicTransformer 添加可配置的 user-agent 支持 #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- 在 auth 方法中添加 user-agent 设置逻辑 - 支持通过 options.userAgent 自定义 user-agent - 保留原始请求中的 user-agent(如果存在) - 默认使用 "claude-cli/1.0.98 (external, cli)" - 同时兼容 user-agent 和 User-Agent 两种格式
添加静态 TransformerName 属性,使 AnthropicTransformer 支持带参数的配置格式, 解决了只能使用字符串格式而不能使用数组格式的问题。
|
修复了参数化配置的文件,不再出现 Provider Not Found 的错误。 |
|
现在的透传模式会直接透传客户端实际请求的header,如果使用claude code的话headers默认就已经是cc的ua了,是否没必要做这步? |
那我改掉,改成无默认值模式。 因为我当前有一个需求,其是从 newapi 请求向 ccr 再由 ccr 请求到具体的提供商。 |
newapi不能设置透传客户端的请求头吗? |
并不能,newapi 目前不支持对请求头的设置。 |
其实不是 newapi 设置头的问题,是一些中转站添加了特殊条件限制cc cli 的调用 我是想加个自定义的Transformer来处理,但完全行不通,Tramsformer 的逻辑很奇怪,transformer 的数量设置影响执行逻辑。看我提了一个 issure #47 ,现在只能通过改源代码的方式修改 https://linux.do/t/topic/1047550/18 |
更好地实现了用户可选的流量伪装