能够实现免翻墙,白嫖 vercel 的 ip
(其实只是没人需要用的东西,大家都转 Claude 不是吗)
vercel.json
文件内写入下面的东西
{
"version": 2,
"routes": [
{
"src": "/oauth/token",
"dest": "https://auth0.openai.com",
"headers": {
"Access-Control-Allow-Credentials": "true",
"Access-Control-Allow-Origin": "*",
"Access-Control-Allow-Methods": "*",
"Access-Control-Allow-Headers": "*"
}
}
]
}
npm 安装 vercel 包
然后 vercel --prod 即可完成部署。
如何调用?vercel 配置自定义域名后,html 中可使用
let url = 'https://YOUR_DOMAIN/oauth/token';
let response = await fetch(url, {
method: 'POST',
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
redirect_uri: "com.openai.chat://auth0.openai.com/ios/com.openai.chat/callback",
grant_type: "refresh_token",
client_id: "pdlLIX2Y72MIl2rhLhTE9VV9bN905kBh",
refresh_token: encodeURIComponent(refreshToken)
})
});