mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 21:37:11 +00:00
fix: add support for claude.ai reverse proxy
This commit is contained in:
parent
bb51e53e02
commit
08e92d871e
3 changed files with 13 additions and 4 deletions
|
|
@ -601,16 +601,22 @@ export function supportGuoba () {
|
||||||
bottomHelpMessage: 'claude.ai Cookie中的SessionKey',
|
bottomHelpMessage: 'claude.ai Cookie中的SessionKey',
|
||||||
component: 'Input'
|
component: 'Input'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
field: 'claudeAIReverseProxy',
|
||||||
|
label: 'claude2 反代',
|
||||||
|
bottomHelpMessage: 'claude.ai 的反代。或许可以参考https://github.com/ikechan8370/sydney-ws-proxy/tree/claude.ai搭建',
|
||||||
|
component: 'Input'
|
||||||
|
},
|
||||||
{
|
{
|
||||||
field: 'claudeAIJA3',
|
field: 'claudeAIJA3',
|
||||||
label: 'claude2浏览器指纹',
|
label: 'claude2浏览器指纹',
|
||||||
bottomHelpMessage: 'claude.ai使用的浏览器TLS指纹,去https://scrapfly.io/web-scraping-tools/ja3-fingerprint或https://ja3.zone/check查看',
|
bottomHelpMessage: 'claude.ai使用的浏览器TLS指纹,去https://scrapfly.io/web-scraping-tools/ja3-fingerprint或https://ja3.zone/check查看。如果用了反代就不用管',
|
||||||
component: 'Input'
|
component: 'Input'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'claudeAIUA',
|
field: 'claudeAIUA',
|
||||||
label: 'claude2浏览器UA',
|
label: 'claude2浏览器UA',
|
||||||
bottomHelpMessage: 'claude.ai使用的浏览器UA,去https://scrapfly.io/web-scraping-tools/ja3-fingerprint或https://ja3.zone/check查看',
|
bottomHelpMessage: 'claude.ai使用的浏览器UA,https://scrapfly.io/web-scraping-tools/http2-fingerprint或https://ja3.zone/check查看。如果用了反代就不用管',
|
||||||
component: 'Input'
|
component: 'Input'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -103,8 +103,9 @@ export class ClaudeAIClient {
|
||||||
// redirect: 'manual'
|
// redirect: 'manual'
|
||||||
// // referrer: 'https://claude.ai/chat/bba5a67d-ee59-4196-a371-ece8a35db1f2'
|
// // referrer: 'https://claude.ai/chat/bba5a67d-ee59-4196-a371-ece8a35db1f2'
|
||||||
// })
|
// })
|
||||||
|
let host = Config.claudeAIReverseProxy || 'https://claude.ai'
|
||||||
const cycleTLS = await initCycleTLS()
|
const cycleTLS = await initCycleTLS()
|
||||||
let result = await cycleTLS(`https://claude.ai/api/organizations/${this.organizationId}/chat_conversations`, {
|
let result = await cycleTLS(`${host}/api/organizations/${this.organizationId}/chat_conversations`, {
|
||||||
ja3: this.JA3,
|
ja3: this.JA3,
|
||||||
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
|
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
|
||||||
proxy: this.proxy,
|
proxy: this.proxy,
|
||||||
|
|
@ -140,7 +141,8 @@ export class ClaudeAIClient {
|
||||||
timezone: 'Asia/Hong_Kong'
|
timezone: 'Asia/Hong_Kong'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let url = 'https://claude.ai/api/append_message'
|
let host = Config.claudeAIReverseProxy || 'https://claude.ai'
|
||||||
|
let url = host + '/api/append_message'
|
||||||
const cycleTLS = await initCycleTLS()
|
const cycleTLS = await initCycleTLS()
|
||||||
let streamDataRes = await cycleTLS(url, {
|
let streamDataRes = await cycleTLS(url, {
|
||||||
ja3: this.JA3,
|
ja3: this.JA3,
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,7 @@ const defaultConfig = {
|
||||||
// claude2
|
// claude2
|
||||||
claudeAIOrganizationId: '',
|
claudeAIOrganizationId: '',
|
||||||
claudeAISessionKey: '',
|
claudeAISessionKey: '',
|
||||||
|
claudeAIReverseProxy: '',
|
||||||
claudeAIJA3: '772,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,27-5-65281-13-35-0-51-18-16-43-10-45-11-17513-23,29-23-24,0',
|
claudeAIJA3: '772,4865-4866-4867-49195-49199-49196-49200-52393-52392-49171-49172-156-157-47-53,27-5-65281-13-35-0-51-18-16-43-10-45-11-17513-23,29-23-24,0',
|
||||||
claudeAIUA: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
|
claudeAIUA: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36',
|
||||||
version: 'v2.7.4'
|
version: 'v2.7.4'
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue