├── public ├── frok.png ├── favicon.ico ├── proxy.png ├── vercel.png ├── zeabur.png ├── zeabur-1.png ├── zeabur-2.png ├── zeabur-3.png ├── zeabur-4.png ├── zeabur-5.png ├── zeabur-1-1.png ├── vercel-deploy.png ├── vercel-domain.png ├── vercel-success.png ├── openai-translator.png ├── chatgpt-proxy-banner.png ├── vercel.svg ├── thirteen.svg └── next.svg ├── .dockerignore ├── jsconfig.json ├── src ├── pages │ ├── _app.js │ ├── api │ │ ├── hello.js │ │ └── proxy-sse.js │ ├── _document.js │ └── index.js └── styles │ ├── globals.css │ └── Home.module.css ├── Dockerfile ├── package.json ├── next.config.js ├── .gitignore ├── README-CN.md ├── README.md └── pnpm-lock.yaml /public/frok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/frok.png -------------------------------------------------------------------------------- /public/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/favicon.ico -------------------------------------------------------------------------------- /public/proxy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/proxy.png -------------------------------------------------------------------------------- /public/vercel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/vercel.png -------------------------------------------------------------------------------- /public/zeabur.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/zeabur.png -------------------------------------------------------------------------------- /public/zeabur-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/zeabur-1.png -------------------------------------------------------------------------------- /public/zeabur-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/zeabur-2.png -------------------------------------------------------------------------------- /public/zeabur-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/zeabur-3.png -------------------------------------------------------------------------------- /public/zeabur-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/zeabur-4.png -------------------------------------------------------------------------------- /public/zeabur-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/zeabur-5.png -------------------------------------------------------------------------------- /public/zeabur-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/zeabur-1-1.png -------------------------------------------------------------------------------- /public/vercel-deploy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/vercel-deploy.png -------------------------------------------------------------------------------- /public/vercel-domain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/vercel-domain.png -------------------------------------------------------------------------------- /public/vercel-success.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/vercel-success.png -------------------------------------------------------------------------------- /.dockerignore: -------------------------------------------------------------------------------- 1 | Dockerfile 2 | .dockerignore 3 | node_modules 4 | npm-debug.log 5 | README*.md 6 | .next 7 | .git -------------------------------------------------------------------------------- /public/openai-translator.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/openai-translator.png -------------------------------------------------------------------------------- /jsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "paths": { 4 | "@/*": ["./src/*"] 5 | } 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /public/chatgpt-proxy-banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/imyuanx/chatgpt-proxy/HEAD/public/chatgpt-proxy-banner.png -------------------------------------------------------------------------------- /src/pages/_app.js: -------------------------------------------------------------------------------- 1 | import '@/styles/globals.css' 2 | 3 | export default function App({ Component, pageProps }) { 4 | return 5 | } 6 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM node:16-alpine 2 | RUN mkdir -p /usr/app 3 | WORKDIR /usr/app 4 | COPY . . 5 | RUN npm install 6 | RUN npm run build 7 | ENV PORT 3000 8 | EXPOSE $PORT 9 | CMD npm run start -- -p $PORT -------------------------------------------------------------------------------- /src/pages/api/hello.js: -------------------------------------------------------------------------------- 1 | // Next.js API route support: https://nextjs.org/docs/api-routes/introduction 2 | 3 | export default function handler(req, res) { 4 | res.status(200).json({ name: 'John Doe' }) 5 | } 6 | -------------------------------------------------------------------------------- /src/pages/_document.js: -------------------------------------------------------------------------------- 1 | import { Html, Head, Main, NextScript } from 'next/document' 2 | 3 | export default function Document() { 4 | return ( 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | ) 13 | } 14 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "chatgpt-proxy", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint" 10 | }, 11 | "dependencies": { 12 | "clipboard": "^2.0.11", 13 | "next": "13.2.3", 14 | "react": "18.2.0", 15 | "react-dom": "18.2.0", 16 | "react-toastify": "^9.1.1" 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /next.config.js: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = { 3 | reactStrictMode: true, 4 | async rewrites() { 5 | return [ 6 | { 7 | source: "/proxy/:slug*", 8 | destination: "https://api.openai.com/:slug*", 9 | }, 10 | { 11 | source: "/proxy-sse/:slug*", 12 | destination: "/api/proxy-sse?path=:slug*", 13 | }, 14 | ]; 15 | }, 16 | }; 17 | 18 | module.exports = nextConfig; 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. 2 | 3 | # dependencies 4 | /node_modules 5 | /.pnp 6 | .pnp.js 7 | 8 | # testing 9 | /coverage 10 | 11 | # next.js 12 | /.next/ 13 | /out/ 14 | 15 | # production 16 | /build 17 | 18 | # misc 19 | .DS_Store 20 | *.pem 21 | 22 | # debug 23 | npm-debug.log* 24 | yarn-debug.log* 25 | yarn-error.log* 26 | .pnpm-debug.log* 27 | 28 | # local env files 29 | .env*.local 30 | 31 | # vercel 32 | .vercel 33 | 34 | # custom 35 | .history -------------------------------------------------------------------------------- /public/vercel.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/styles/globals.css: -------------------------------------------------------------------------------- 1 | :root { 2 | --max-width: 1100px; 3 | --border-radius: 12px; 4 | --font-mono: ui-monospace, Menlo, Monaco, "Cascadia Mono", "Segoe UI Mono", 5 | "Roboto Mono", "Oxygen Mono", "Ubuntu Monospace", "Source Code Pro", 6 | "Fira Mono", "Droid Sans Mono", "Courier New", monospace; 7 | } 8 | 9 | * { 10 | box-sizing: border-box; 11 | padding: 0; 12 | margin: 0; 13 | } 14 | 15 | html, 16 | body { 17 | max-width: 100vw; 18 | overflow-x: hidden; 19 | } 20 | 21 | body { 22 | display: flex; 23 | flex-direction: column; 24 | align-items: center; 25 | padding: 6rem; 26 | min-height: 100vh; 27 | font-family: var(--font-mono); 28 | } 29 | 30 | @media (prefers-color-scheme: dark) { 31 | html { 32 | color-scheme: dark; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/pages/api/proxy-sse.js: -------------------------------------------------------------------------------- 1 | export const config = { runtime: "edge" }; 2 | 3 | export default async function handler(req, res) { 4 | const { 5 | nextUrl: { pathname }, 6 | method, 7 | headers, 8 | body, 9 | } = req; 10 | headers.delete("host"); 11 | headers.delete("referer"); 12 | 13 | let path = pathname.split("/proxy-sse"); 14 | path.shift(); 15 | path = path.join(""); 16 | 17 | const url = `https://api.openai.com${path}`; 18 | const options = { 19 | headers: headers, 20 | method: method, 21 | body: body, 22 | redirect: "follow", 23 | }; 24 | const modifiedRequest = new Request(url, options); 25 | try { 26 | const response = await fetch(modifiedRequest); 27 | const modifiedResponse = new Response(response.body, response); 28 | modifiedResponse.headers.set("Access-Control-Allow-Origin", "*"); 29 | return modifiedResponse; 30 | } catch (e) { 31 | console.log("catch: ", e); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /public/thirteen.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /public/next.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/styles/Home.module.css: -------------------------------------------------------------------------------- 1 | .main { 2 | display: flex; 3 | flex-direction: column; 4 | justify-content: space-between; 5 | align-items: center; 6 | width: 100%; 7 | height: 100%; 8 | max-width: 800px; 9 | } 10 | 11 | .description { 12 | display: flex; 13 | flex-direction: column; 14 | gap: 48px; 15 | justify-content: center; 16 | align-items: center; 17 | font-size: 0.85rem; 18 | } 19 | 20 | .titleBox { 21 | position: relative; 22 | width: 100%; 23 | } 24 | 25 | .description h1 { 26 | font-size: 56px; 27 | width: 100%; 28 | text-align: center; 29 | } 30 | 31 | .title { 32 | color: transparent; 33 | background-clip: text; 34 | background-image: linear-gradient( 35 | to right, 36 | rgb(255, 0, 89), 37 | rgb(255, 0, 217), 38 | rgb(255, 0, 217), 39 | rgb(132, 0, 255) 40 | ); 41 | } 42 | 43 | .titleMask { 44 | position: absolute; 45 | color: black; 46 | top: 0px; 47 | pointer-events: none; 48 | overflow: hidden; 49 | height: 48px; 50 | transition: all 0.6s; 51 | } 52 | 53 | .content p { 54 | display: flex; 55 | align-items: center; 56 | font-size: 16px; 57 | gap: 8px; 58 | } 59 | 60 | .content { 61 | text-align: left; 62 | display: flex; 63 | flex-direction: column; 64 | gap: 16px; 65 | width: 95%; 66 | margin-top: 32px; 67 | } 68 | 69 | .code { 70 | padding: 4px 6px; 71 | border-radius: 3px; 72 | font-weight: 700; 73 | background-color: #f0f0f0; 74 | } 75 | 76 | .copyIcon { 77 | cursor: pointer; 78 | } 79 | 80 | .copyIcon:hover { 81 | opacity: 0.5; 82 | } 83 | 84 | .faq { 85 | width: 95%; 86 | margin-top: 48px; 87 | display: flex; 88 | flex-direction: column; 89 | gap: 16px; 90 | } 91 | 92 | .footer { 93 | position: fixed; 94 | bottom: 24px; 95 | text-align: center; 96 | } 97 | -------------------------------------------------------------------------------- /README-CN.md: -------------------------------------------------------------------------------- 1 | ![Banner](./public/chatgpt-proxy-banner.png) 2 | 3 | 一键式部署 ChatGPT 私有代理,由 Next.js 驱动,支持 SSE! 4 | 5 | 简体中文 | [English](./README.md) 6 | 7 | ## 简介 8 | 9 | 此项目基于 Next.js,使用 Rewriter 完成代理功能,核心代码只有 [2 行](https://github.com/imyuanx/chatgpt-proxy/blob/main/next.config.js#L7-L8),结合 Zeabur 或 Vercel 可以很简单的托管你的私有代理服务 10 | 11 | 开始之前,最好先查看[如何使用](#如何使用)章节判断此项目是否适用于你 12 | 13 | ps: SSE 部分的代码来自 [chatgptProxyAPI](https://github.com/x-dr/chatgptProxyAPI) 14 | 15 | ## 快速跳转 16 | 17 | - [在你的服务器上部署](#在你的服务器上部署) 18 | - ~~[在 Zeabur 上部署](#在-zeabur-上部署)~~ 19 | - ~~[在 Vercel 上部署](#在-vercel-上部署)~~ 20 | - [如何使用](#如何使用) 21 | 22 | ## 在你的服务器上部署 23 | 24 | > 你必须有一个服务器并且确保你的服务器可以访问 ChatGPT 25 | > 26 | > 你需要一些关于 [Docker](https://www.docker.com/) 相关的知识 27 | 28 | 1. Fork 这个仓库为你自己的仓库 29 | 30 | fork 31 | 32 | 2. 切换到你 Fork 的项目目录下并运行 `docker build -t chatgpt-proxy .` 33 | 34 | 3. 然后运行 `docker run --name chatgpt-proxy -d -p 8000:3000 chatgpt-proxy` 35 | 36 | 4. 在浏览器中打开 `http://127.0.0.1:8000` 37 | 38 | 如果你不使用 Docker,你也可以手动部署它 39 | 40 |
41 | 手动部署步骤 42 | 43 | > 你的 nodejs 版本需要大于或等于 14 44 | 45 | #### 1. 将此仓库 pull 到本地 46 | 47 | ```bash 48 | $ git pull https://github.com/imyuanx/chatgpt-proxy 49 | $ cd chatgpt-proxy 50 | ``` 51 | 52 | #### 2. 下载依赖 53 | 54 | ```bash 55 | $ pnpm install 56 | ``` 57 | 58 | #### 3. 编译 59 | 60 | ```bash 61 | $ pnpm build 62 | ``` 63 | 64 | #### 4. 启动服务 65 | 66 | ```bash 67 | $ pnpm start 68 | ``` 69 | 70 |
71 | 72 | ## 在 Zeabur 上部署 73 | 74 | > ❗️⚠️❗️**警告:根据 Zeabur 使用条款,此项目或许违反了 `Never Fair Use - Proxies and VPNs` 条目,强烈不推荐使用 Zeabur 托管此项目!** 75 | > 76 | > ❗️⚠️❗️**警告:如果因为部署此项目到 Zeabur 导致您的账号被处罚,请自行承担后果** 77 | 78 |
79 | 80 | 部署步骤 81 | 82 | > ❗️⚠️❗️**在完全阅读警告信息,了解可能存在的风险和后果的前提下,您可以继续完成部署** 83 | 84 | 具体操作如下 85 | 86 | 1. Fork 这个仓库为你自己的仓库 87 | 88 | fork 89 | 90 | 2. 在 [Zeabur](https://zeabur.com) 控制台新增一个服务 91 | 92 | 步骤 1 93 | 94 | 3. 点击添加服务然后选择从源码部署 95 | 96 | 步骤 2 97 | 98 | 步骤 2-1 99 | 100 | 4. 选择你 fork 的仓库 101 | 102 | 步骤 3 103 | 104 | 5. 选择 main 分支,开始部署 105 | 106 | 步骤 4 107 | 108 | 6. 部署成功后,点击生成域名 109 | 110 | 步骤 5 111 | 112 | 7. 最后得到你的服务 113 | 114 | 步骤 6 115 | 116 |
117 | 118 | ## 在 Vercel 上部署 119 | 120 | > ❗️⚠️❗️**警告:根据 Vercel 使用条款,此项目或许违反了 [Never Fair Use - Proxies and VPNs](https://vercel.com/docs/concepts/limits/fair-use-policy#never-fair-use) 条目,强烈不推荐使用 Vercel 托管此项目!** 121 | > 122 | > ❗️⚠️❗️**警告:如果因为部署此项目到 Vercel 导致您的账号被处罚,请自行承担后果** 123 | 124 |
125 | 126 | 部署步骤 127 | 128 | > ❗️⚠️❗️**在完全阅读警告信息,了解可能存在的风险和后果的前提下,您可以继续完成部署** 129 | 130 | 如果使用 Vercel 部署服务,必须[自定义域名](https://vercel.com/docs/concepts/get-started/assign-domain),因为自定义域名不受 GFW 影响,具体操作如下 131 | 132 | 部署到 Vercel 133 | 134 | 1. 点击上方一键部署按钮 135 | 136 | One-click deploy 137 | 138 | 2. 部署后会自动为你 fork 此仓库,在输入框中输入自定义的仓库名称 139 | 140 | Deploy 141 | 142 | 3. 部署成功后,得到你的服务 143 | 144 | Alt text 145 | 146 | 4. 你必须为你的服务添加一个自定义域名,否则你将不能在国内访问你的服务 147 | 148 | Domain 149 | 150 |
151 | 152 | ## 如何使用 153 | 154 | 无论你使用 Zeabur 还是 Vercel,部署完成后你都会得到以下这个代理服务 155 | 156 | Proxy service 157 | 158 | 得到的两个地址都会完全转发到 `https://api.openai.com` 并且都可在国内可访问,其中 `.../proxy-sse` 支持 SSE 159 | 160 | 你可以在支持自定义 `API` 的应用中使用你的代理服务,实现在国内调用 `openai` 接口的目的 161 | 162 | 例如[openai-translator](https://github.com/yetone/openai-translator): 163 | 164 | Alt text 165 | 166 | [回到顶部](#简介) 167 | -------------------------------------------------------------------------------- /src/pages/index.js: -------------------------------------------------------------------------------- 1 | import Head from "next/head"; 2 | import styles from "@/styles/Home.module.css"; 3 | import { useEffect, useState } from "react"; 4 | import ClipboardJS from "clipboard"; 5 | import { ToastContainer, toast } from "react-toastify"; 6 | import "react-toastify/dist/ReactToastify.css"; 7 | 8 | export default function Home() { 9 | const [link, setLink] = useState(""); 10 | const [linkSSE, setLinkSSE] = useState(""); 11 | const [copied, setCopied] = useState(false); 12 | 13 | useEffect(() => { 14 | const { origin } = location; 15 | setLink(`${origin}/proxy`); 16 | setLinkSSE(`${origin}/proxy-sse`); 17 | const clipboard = new ClipboardJS("#copy"); 18 | clipboard.on("success", notify); 19 | return () => clipboard.destroy(); 20 | }, []); 21 | 22 | const notify = () => { 23 | toast("🦄️ Copied !", { autoClose: 1600 }); 24 | setCopied(true); 25 | }; 26 | 27 | return ( 28 | <> 29 | 30 | ChatGPT Proxy 31 | 32 | 33 | 34 | 35 |
36 |
37 |
38 |

ChatGPT Proxy

39 |

43 | ChatGPT Proxy 44 |

45 |
46 |
47 |
48 |

Your proxy link:

49 |

50 | {link} 51 | 60 | 64 | 65 |

66 |

67 | {linkSSE} 68 | 77 | 81 | 82 |

83 |
84 |
85 |

What's this?

86 |

87 | 91 | See more 92 | 93 |

94 |

How to use?

95 |

96 | 100 | See more 101 | 102 |

103 |
104 | 114 |
115 | 116 | 117 | ); 118 | } 119 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![Banner](./public/chatgpt-proxy-banner.png) 2 | 3 | One-click deployment of the ChatGPT private proxy, power by Next.js, support SSE! 4 | 5 | English | [简体中文](./README-CN.md) 6 | 7 | ## Introduction 8 | 9 | This project is based on Next.js, use Rewriter to complete proxy function, only [2 lines](https://github.com/imyuanx/chatgpt-proxy/blob/main/next.config.js#L7-L8) of core code, combining Zeabur or Vercel can easily host your private proxy service 10 | 11 | Before you start, you'd better check the [How to use](#how-to-use) section to determine whether this project is applicable to you 12 | 13 | ps: The SSE part of the code from [chatgptProxyAPI](https://github.com/x-dr/chatgptProxyAPI) 14 | 15 | ## Quick jump 16 | 17 | - [Deploy on your server](#deploy-on-your-server) 18 | - ~~[Deploy on Zeabur](#deploy-on-zeabur)~~ 19 | - ~~[Deploy on Vercel](#deploy-on-vercel)~~ 20 | - [How to use](#how-to-use) 21 | 22 | ## Deploy on your server 23 | 24 | > You must have a server and make sure your server can access ChatGPT 25 | > 26 | > You need some knowledge about [Docker](https://www.docker.com/) 27 | 28 | 1. Fork this repository for your own repository 29 | 30 | fork 31 | 32 | 2. Switch to the your forked project directory and run `docker build -t chatgpt-proxy .` 33 | 34 | 3. then run `docker run --name chatgpt-proxy -d -p 8000:3000 chatgpt-proxy` 35 | 36 | 4. open `http://127.0.0.1:8000` on your browser 37 | 38 | If you don't use Docker, you can also manually deploy it 39 | 40 |
41 | Steps for manually deploy 42 | 43 | > Your nodejs version needs to be greater than or equal to 14 44 | 45 | #### 1. Pull this repo to the local 46 | 47 | ```bash 48 | $ git pull https://github.com/imyuanx/chatgpt-proxy 49 | $ cd chatgpt-proxy 50 | ``` 51 | 52 | #### 2. Installations 53 | 54 | ```bash 55 | $ pnpm install 56 | ``` 57 | 58 | #### 3. Build 59 | 60 | ```bash 61 | $ pnpm build 62 | ``` 63 | 64 | #### 4. Running Services 65 | 66 | ```bash 67 | $ pnpm start 68 | ``` 69 | 70 |
71 | 72 | ## Deploy on Zeabur 73 | 74 | > ❗️⚠️❗️**Warning: This project may violate the `Never Fair Use - Proxies and VPNs` entries under the Zeabur Terms of Use. Zeabur hosting this project is strongly not recommended!** 75 | > 76 | > ❗️⚠️❗️**Warning: If your account is punished due to the deployment of this project to Zeabur, please bear the consequences** 77 | 78 |
79 | Steps for deployment 80 | 81 | > ❗️⚠️❗️**Assuming that you have completely read the warning information and understand the possible risks and consequences, you can still continue to complete the deployment** 82 | 83 | Specific operations are as follows 84 | 85 | 1. Fork this repository for your own repository 86 | 87 | fork 88 | 89 | 2. Add a new service on [Zeabur](https://zeabur.com) console 90 | 91 | step 1 92 | 93 | 3. Add service and deploy from source code 94 | 95 | step 2 96 | 97 | step 2-1 98 | 99 | 4. Select your forked repo 100 | 101 | step 3 102 | 103 | 5. Select main and deploy 104 | 105 | step 4 106 | 107 | 6. After the deployment is successful, Generate the domain name. 108 | 109 | step 5 110 | 111 | 7. Finally get your service 112 | 113 | step 6 114 |
115 | 116 | ## Deploy on Vercel 117 | 118 | > ❗️⚠️❗️**Warning: This project may violate the [Never Fair Use - Proxies and VPNs](https://vercel.com/docs/concepts/limits/fair-use-policy#never-fair-use) entries under the Vercel Terms of Use. Vercel hosting this project is strongly not recommended!** 119 | > 120 | > ❗️⚠️❗️**Warning: If your account is punished due to the deployment of this project to Vercel, please bear the consequences** 121 | 122 |
123 | 124 | Steps for deployment 125 | 126 | > ❗️⚠️❗️**Assuming that you have completely read the warning information and understand the possible risks and consequences, you can still continue to complete the deployment** 127 | 128 | If you use Vercel deploy services, you must [custom domain name](https://vercel.com/docs/concepts/get-started/assign-domain), beacuse the [custom domain name](https://vercel.com/docs/concepts/get-started/assign-domain) is not affected by the GFW, Specific operations are as follows 129 | 130 | Deploy to Vercel 131 | 132 | 1. Click the deploy button at the top 133 | 134 | One-click deploy 135 | 136 | 2. After deployment, the repository will be forked automatically for you, entering a custom repository name in the input field 137 | 138 | Deploy 139 | 140 | 3. After successful deployment, get your service 141 | 142 | Alt text 143 | 144 | 4. You must add a custom domain name for your service, otherwise you will not be able to access your service in the country 145 | 146 | Domain 147 |
148 | 149 | ## How to use 150 | 151 | Whether you use Zeabur or Vercel, you will get the following proxy service after deployment 152 | 153 | Proxy service 154 | 155 | The resulting two addresses will be fully forwarded to `https://api.openai.com` and both will be domestically accessible, where `.../proxy-sse` supports SSE 156 | 157 | You can use the proxy service in applications that support custom apis to invoke the "openai" interface domestically 158 | 159 | Fro example, [openai-translator](https://github.com/yetone/openai-translator): 160 | 161 | Alt text 162 | 163 | [Back to top](#introduction) 164 | -------------------------------------------------------------------------------- /pnpm-lock.yaml: -------------------------------------------------------------------------------- 1 | lockfileVersion: 5.3 2 | 3 | specifiers: 4 | clipboard: ^2.0.11 5 | next: 13.2.3 6 | react: 18.2.0 7 | react-dom: 18.2.0 8 | react-toastify: ^9.1.1 9 | 10 | dependencies: 11 | clipboard: 2.0.11 12 | next: 13.2.3_react-dom@18.2.0+react@18.2.0 13 | react: 18.2.0 14 | react-dom: 18.2.0_react@18.2.0 15 | react-toastify: 9.1.1_react-dom@18.2.0+react@18.2.0 16 | 17 | packages: 18 | 19 | /@next/env/13.2.3: 20 | resolution: {integrity: sha512-FN50r/E+b8wuqyRjmGaqvqNDuWBWYWQiigfZ50KnSFH0f+AMQQyaZl+Zm2+CIpKk0fL9QxhLxOpTVA3xFHgFow==} 21 | dev: false 22 | 23 | /@next/swc-android-arm-eabi/13.2.3: 24 | resolution: {integrity: sha512-mykdVaAXX/gm+eFO2kPeVjnOCKwanJ9mV2U0lsUGLrEdMUifPUjiXKc6qFAIs08PvmTMOLMNnUxqhGsJlWGKSw==} 25 | engines: {node: '>= 10'} 26 | cpu: [arm] 27 | os: [android] 28 | requiresBuild: true 29 | dev: false 30 | optional: true 31 | 32 | /@next/swc-android-arm64/13.2.3: 33 | resolution: {integrity: sha512-8XwHPpA12gdIFtope+n9xCtJZM3U4gH4vVTpUwJ2w1kfxFmCpwQ4xmeGSkR67uOg80yRMuF0h9V1ueo05sws5w==} 34 | engines: {node: '>= 10'} 35 | cpu: [arm64] 36 | os: [android] 37 | requiresBuild: true 38 | dev: false 39 | optional: true 40 | 41 | /@next/swc-darwin-arm64/13.2.3: 42 | resolution: {integrity: sha512-TXOubiFdLpMfMtaRu1K5d1I9ipKbW5iS2BNbu8zJhoqrhk3Kp7aRKTxqFfWrbliAHhWVE/3fQZUYZOWSXVQi1w==} 43 | engines: {node: '>= 10'} 44 | cpu: [arm64] 45 | os: [darwin] 46 | requiresBuild: true 47 | dev: false 48 | optional: true 49 | 50 | /@next/swc-darwin-x64/13.2.3: 51 | resolution: {integrity: sha512-GZctkN6bJbpjlFiS5pylgB2pifHvgkqLAPumJzxnxkf7kqNm6rOGuNjsROvOWVWXmKhrzQkREO/WPS2aWsr/yw==} 52 | engines: {node: '>= 10'} 53 | cpu: [x64] 54 | os: [darwin] 55 | requiresBuild: true 56 | dev: false 57 | optional: true 58 | 59 | /@next/swc-freebsd-x64/13.2.3: 60 | resolution: {integrity: sha512-rK6GpmMt/mU6MPuav0/M7hJ/3t8HbKPCELw/Uqhi4732xoq2hJ2zbo2FkYs56y6w0KiXrIp4IOwNB9K8L/q62g==} 61 | engines: {node: '>= 10'} 62 | cpu: [x64] 63 | os: [freebsd] 64 | requiresBuild: true 65 | dev: false 66 | optional: true 67 | 68 | /@next/swc-linux-arm-gnueabihf/13.2.3: 69 | resolution: {integrity: sha512-yeiCp/Odt1UJ4KUE89XkeaaboIDiVFqKP4esvoLKGJ0fcqJXMofj4ad3tuQxAMs3F+qqrz9MclqhAHkex1aPZA==} 70 | engines: {node: '>= 10'} 71 | cpu: [arm] 72 | os: [linux] 73 | requiresBuild: true 74 | dev: false 75 | optional: true 76 | 77 | /@next/swc-linux-arm64-gnu/13.2.3: 78 | resolution: {integrity: sha512-/miIopDOUsuNlvjBjTipvoyjjaxgkOuvlz+cIbbPcm1eFvzX2ltSfgMgty15GuOiR8Hub4FeTSiq3g2dmCkzGA==} 79 | engines: {node: '>= 10'} 80 | cpu: [arm64] 81 | os: [linux] 82 | requiresBuild: true 83 | dev: false 84 | optional: true 85 | 86 | /@next/swc-linux-arm64-musl/13.2.3: 87 | resolution: {integrity: sha512-sujxFDhMMDjqhruup8LLGV/y+nCPi6nm5DlFoThMJFvaaKr/imhkXuk8uCTq4YJDbtRxnjydFv2y8laBSJVC2g==} 88 | engines: {node: '>= 10'} 89 | cpu: [arm64] 90 | os: [linux] 91 | requiresBuild: true 92 | dev: false 93 | optional: true 94 | 95 | /@next/swc-linux-x64-gnu/13.2.3: 96 | resolution: {integrity: sha512-w5MyxPknVvC9LVnMenAYMXMx4KxPwXuJRMQFvY71uXg68n7cvcas85U5zkdrbmuZ+JvsO5SIG8k36/6X3nUhmQ==} 97 | engines: {node: '>= 10'} 98 | cpu: [x64] 99 | os: [linux] 100 | requiresBuild: true 101 | dev: false 102 | optional: true 103 | 104 | /@next/swc-linux-x64-musl/13.2.3: 105 | resolution: {integrity: sha512-CTeelh8OzSOVqpzMFMFnVRJIFAFQoTsI9RmVJWW/92S4xfECGcOzgsX37CZ8K982WHRzKU7exeh7vYdG/Eh4CA==} 106 | engines: {node: '>= 10'} 107 | cpu: [x64] 108 | os: [linux] 109 | requiresBuild: true 110 | dev: false 111 | optional: true 112 | 113 | /@next/swc-win32-arm64-msvc/13.2.3: 114 | resolution: {integrity: sha512-7N1KBQP5mo4xf52cFCHgMjzbc9jizIlkTepe9tMa2WFvEIlKDfdt38QYcr9mbtny17yuaIw02FXOVEytGzqdOQ==} 115 | engines: {node: '>= 10'} 116 | cpu: [arm64] 117 | os: [win32] 118 | requiresBuild: true 119 | dev: false 120 | optional: true 121 | 122 | /@next/swc-win32-ia32-msvc/13.2.3: 123 | resolution: {integrity: sha512-LzWD5pTSipUXTEMRjtxES/NBYktuZdo7xExJqGDMnZU8WOI+v9mQzsmQgZS/q02eIv78JOCSemqVVKZBGCgUvA==} 124 | engines: {node: '>= 10'} 125 | cpu: [ia32] 126 | os: [win32] 127 | requiresBuild: true 128 | dev: false 129 | optional: true 130 | 131 | /@next/swc-win32-x64-msvc/13.2.3: 132 | resolution: {integrity: sha512-aLG2MaFs4y7IwaMTosz2r4mVbqRyCnMoFqOcmfTi7/mAS+G4IMH0vJp4oLdbshqiVoiVuKrAfqtXj55/m7Qu1Q==} 133 | engines: {node: '>= 10'} 134 | cpu: [x64] 135 | os: [win32] 136 | requiresBuild: true 137 | dev: false 138 | optional: true 139 | 140 | /@swc/helpers/0.4.14: 141 | resolution: {integrity: sha512-4C7nX/dvpzB7za4Ql9K81xK3HPxCpHMgwTZVyf+9JQ6VUbn9jjZVN7/Nkdz/Ugzs2CSjqnL/UPXroiVBVHUWUw==} 142 | dependencies: 143 | tslib: 2.5.0 144 | dev: false 145 | 146 | /caniuse-lite/1.0.30001460: 147 | resolution: {integrity: sha512-Bud7abqjvEjipUkpLs4D7gR0l8hBYBHoa+tGtKJHvT2AYzLp1z7EmVkUT4ERpVUfca8S2HGIVs883D8pUH1ZzQ==} 148 | dev: false 149 | 150 | /client-only/0.0.1: 151 | resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} 152 | dev: false 153 | 154 | /clipboard/2.0.11: 155 | resolution: {integrity: sha512-C+0bbOqkezLIsmWSvlsXS0Q0bmkugu7jcfMIACB+RDEntIzQIkdr148we28AfSloQLRdZlYL/QYyrq05j/3Faw==} 156 | dependencies: 157 | good-listener: 1.2.2 158 | select: 1.1.2 159 | tiny-emitter: 2.1.0 160 | dev: false 161 | 162 | /clsx/1.2.1: 163 | resolution: {integrity: sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==} 164 | engines: {node: '>=6'} 165 | dev: false 166 | 167 | /delegate/3.2.0: 168 | resolution: {integrity: sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw==} 169 | dev: false 170 | 171 | /good-listener/1.2.2: 172 | resolution: {integrity: sha512-goW1b+d9q/HIwbVYZzZ6SsTr4IgE+WA44A0GmPIQstuOrgsFcT7VEJ48nmr9GaRtNu0XTKacFLGnBPAM6Afouw==} 173 | dependencies: 174 | delegate: 3.2.0 175 | dev: false 176 | 177 | /js-tokens/4.0.0: 178 | resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} 179 | dev: false 180 | 181 | /loose-envify/1.4.0: 182 | resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} 183 | hasBin: true 184 | dependencies: 185 | js-tokens: 4.0.0 186 | dev: false 187 | 188 | /nanoid/3.3.4: 189 | resolution: {integrity: sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw==} 190 | engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} 191 | hasBin: true 192 | dev: false 193 | 194 | /next/13.2.3_react-dom@18.2.0+react@18.2.0: 195 | resolution: {integrity: sha512-nKFJC6upCPN7DWRx4+0S/1PIOT7vNlCT157w9AzbXEgKy6zkiPKEt5YyRUsRZkmpEqBVrGgOqNfwecTociyg+w==} 196 | engines: {node: '>=14.6.0'} 197 | hasBin: true 198 | peerDependencies: 199 | '@opentelemetry/api': ^1.4.0 200 | fibers: '>= 3.1.0' 201 | node-sass: ^6.0.0 || ^7.0.0 202 | react: ^18.2.0 203 | react-dom: ^18.2.0 204 | sass: ^1.3.0 205 | peerDependenciesMeta: 206 | '@opentelemetry/api': 207 | optional: true 208 | fibers: 209 | optional: true 210 | node-sass: 211 | optional: true 212 | sass: 213 | optional: true 214 | dependencies: 215 | '@next/env': 13.2.3 216 | '@swc/helpers': 0.4.14 217 | caniuse-lite: 1.0.30001460 218 | postcss: 8.4.14 219 | react: 18.2.0 220 | react-dom: 18.2.0_react@18.2.0 221 | styled-jsx: 5.1.1_react@18.2.0 222 | optionalDependencies: 223 | '@next/swc-android-arm-eabi': 13.2.3 224 | '@next/swc-android-arm64': 13.2.3 225 | '@next/swc-darwin-arm64': 13.2.3 226 | '@next/swc-darwin-x64': 13.2.3 227 | '@next/swc-freebsd-x64': 13.2.3 228 | '@next/swc-linux-arm-gnueabihf': 13.2.3 229 | '@next/swc-linux-arm64-gnu': 13.2.3 230 | '@next/swc-linux-arm64-musl': 13.2.3 231 | '@next/swc-linux-x64-gnu': 13.2.3 232 | '@next/swc-linux-x64-musl': 13.2.3 233 | '@next/swc-win32-arm64-msvc': 13.2.3 234 | '@next/swc-win32-ia32-msvc': 13.2.3 235 | '@next/swc-win32-x64-msvc': 13.2.3 236 | transitivePeerDependencies: 237 | - '@babel/core' 238 | - babel-plugin-macros 239 | dev: false 240 | 241 | /picocolors/1.0.0: 242 | resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} 243 | dev: false 244 | 245 | /postcss/8.4.14: 246 | resolution: {integrity: sha512-E398TUmfAYFPBSdzgeieK2Y1+1cpdxJx8yXbK/m57nRhKSmk1GB2tO4lbLBtlkfPQTDKfe4Xqv1ASWPpayPEig==} 247 | engines: {node: ^10 || ^12 || >=14} 248 | dependencies: 249 | nanoid: 3.3.4 250 | picocolors: 1.0.0 251 | source-map-js: 1.0.2 252 | dev: false 253 | 254 | /react-dom/18.2.0_react@18.2.0: 255 | resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} 256 | peerDependencies: 257 | react: ^18.2.0 258 | dependencies: 259 | loose-envify: 1.4.0 260 | react: 18.2.0 261 | scheduler: 0.23.0 262 | dev: false 263 | 264 | /react-toastify/9.1.1_react-dom@18.2.0+react@18.2.0: 265 | resolution: {integrity: sha512-pkFCla1z3ve045qvjEmn2xOJOy4ZciwRXm1oMPULVkELi5aJdHCN/FHnuqXq8IwGDLB7PPk2/J6uP9D8ejuiRw==} 266 | peerDependencies: 267 | react: '>=16' 268 | react-dom: '>=16' 269 | dependencies: 270 | clsx: 1.2.1 271 | react: 18.2.0 272 | react-dom: 18.2.0_react@18.2.0 273 | dev: false 274 | 275 | /react/18.2.0: 276 | resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} 277 | engines: {node: '>=0.10.0'} 278 | dependencies: 279 | loose-envify: 1.4.0 280 | dev: false 281 | 282 | /scheduler/0.23.0: 283 | resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} 284 | dependencies: 285 | loose-envify: 1.4.0 286 | dev: false 287 | 288 | /select/1.1.2: 289 | resolution: {integrity: sha512-OwpTSOfy6xSs1+pwcNrv0RBMOzI39Lp3qQKUTPVVPRjCdNa5JH/oPRiqsesIskK8TVgmRiHwO4KXlV2Li9dANA==} 290 | dev: false 291 | 292 | /source-map-js/1.0.2: 293 | resolution: {integrity: sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw==} 294 | engines: {node: '>=0.10.0'} 295 | dev: false 296 | 297 | /styled-jsx/5.1.1_react@18.2.0: 298 | resolution: {integrity: sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==} 299 | engines: {node: '>= 12.0.0'} 300 | peerDependencies: 301 | '@babel/core': '*' 302 | babel-plugin-macros: '*' 303 | react: '>= 16.8.0 || 17.x.x || ^18.0.0-0' 304 | peerDependenciesMeta: 305 | '@babel/core': 306 | optional: true 307 | babel-plugin-macros: 308 | optional: true 309 | dependencies: 310 | client-only: 0.0.1 311 | react: 18.2.0 312 | dev: false 313 | 314 | /tiny-emitter/2.1.0: 315 | resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==} 316 | dev: false 317 | 318 | /tslib/2.5.0: 319 | resolution: {integrity: sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==} 320 | dev: false 321 | --------------------------------------------------------------------------------