├── .eslintrc.json
├── .gitignore
├── LICENSE
├── README.md
├── api
└── proxy.js
├── next.config.js
├── package.json
├── pages
├── _app.js
└── api
│ └── hello.js
├── public
├── favicon.ico
└── vercel.svg
├── styles
├── globals.css
├── index.js
└── index.module.css
└── vercel.json
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "next/core-web-vitals"
3 | }
4 |
--------------------------------------------------------------------------------
/.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 | # typescript
35 | *.tsbuildinfo
36 | next-env.d.ts
37 | package-lock.json
38 | .idea/
39 | yarn.lock
40 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2023 mobaijun
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Google Proxy
2 |
3 | 源项目地址:[传送门](https://github.com/gaowanlu/google)
4 |
5 | ## 主要功能
6 |
7 | - 在 1 分钟内使用 Vercel **免费一键部署**
8 | - 极快的首屏加载速度(~100kb)
9 | - 拥有自己的域名?好上加好,绑定后即可在任何地方**无障碍**快速访问
10 |
11 | ## 开始使用
12 |
13 | 1. 点击右侧按钮开始部署: [](https://vercel.com/new/clone?repository-url=https://github.com/mobaijun/google-proxy&project-name=google-proxy&repository-name=google-proxy)
14 | ,直接使用 Github 账号登录即可;
15 | 2. 部署完毕后,即可开始使用;
16 | 3. (可选)[绑定自定义域名](https://vercel.com/docs/concepts/projects/domains/add-a-domain):Vercel 分配的域名 DNS
17 | 在某些区域被污染了,绑定自定义域名即可直连。
18 |
--------------------------------------------------------------------------------
/api/proxy.js:
--------------------------------------------------------------------------------
1 | const {createProxyMiddleware} = require("http-proxy-middleware");
2 |
3 | module.exports = (req, res) => {
4 | let target = "https://www.google.com/";
5 | // 代理目标地址
6 | // 这里使用 backend 主要用于区分 vercel serverless 的 api 路径
7 | // if (
8 | // req.url.startsWith("/api") ||
9 | // req.url.startsWith("/auth") ||
10 | // req.url.startsWith("/banner") ||
11 | // req.url.startsWith("/CollegeTask")
12 | // ) {
13 | // target = "http://106.15.2.32:6969";
14 | // }
15 |
16 | // 创建代理对象并转发请求
17 | createProxyMiddleware({
18 | target,
19 | changeOrigin: true,
20 | pathRewrite: {
21 | // 通过路径重写,去除请求路径中的 `/backend`
22 | // 例如 /backend/user/login 将被转发到 http://backend-api.com/user/login
23 | // "^/backend/": "/",
24 | },
25 | })(req, res);
26 | };
27 |
--------------------------------------------------------------------------------
/next.config.js:
--------------------------------------------------------------------------------
1 | /** @type {import('next').NextConfig} */
2 | const nextConfig = {
3 | reactStrictMode: true,
4 | swcMinify: true,
5 | }
6 |
7 | module.exports = nextConfig
8 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "april-google-proxy",
3 | "version": "1.0.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 | "next": "14.3.0-canary.0",
13 | "react": "18.2.0",
14 | "react-dom": "18.2.0"
15 | },
16 | "devDependencies": {
17 | "eslint": "8.26.0",
18 | "eslint-config-next": "13.0.0",
19 | "http-proxy-middleware": "^2.0.6"
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/pages/_app.js:
--------------------------------------------------------------------------------
1 | import '../styles/globals.css'
2 |
3 | function MyApp({Component, pageProps}) {
4 | return
5 | }
6 |
7 | export default MyApp
8 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/public/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/april-projects/april-google-proxy/d0336c6be0d59226506f522f57d420be1b8509ca/public/favicon.ico
--------------------------------------------------------------------------------
/public/vercel.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/styles/globals.css:
--------------------------------------------------------------------------------
1 | html,
2 | body {
3 | padding: 0;
4 | margin: 0;
5 | font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
6 | Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
7 | }
8 |
9 | a {
10 | color: inherit;
11 | text-decoration: none;
12 | }
13 |
14 | * {
15 | box-sizing: border-box;
16 | }
17 |
18 | @media (prefers-color-scheme: dark) {
19 | html {
20 | color-scheme: dark;
21 | }
22 |
23 | body {
24 | color: white;
25 | background: black;
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/styles/index.js:
--------------------------------------------------------------------------------
1 | import Head from "next/head";
2 | import styles from "/styles/index.module.css";
3 | import Link from "next/link";
4 |
5 | export default function Home() {
6 | return (
7 |
8 |
9 |
Colnago
10 |
11 |
12 |
13 |
14 |
15 |
16 | Welcome to Colango!
17 |
18 |
19 |
20 | Let's go right now
21 |
22 |
23 |
24 |
25 |
个人信息 →
26 |
配置您的个人相关信息
27 |
28 |
29 |
30 |
我的发布 →
31 |
查看您以往发布的内容
32 |
33 |
34 |
35 |
探索发现 →
36 |
探索和你一样有趣的人
37 |
38 |
39 |
45 |
关于我们 →
46 |
欢迎加入我们
47 |
48 |
49 |
50 |
51 |
59 |
60 | );
61 | }
62 |
--------------------------------------------------------------------------------
/styles/index.module.css:
--------------------------------------------------------------------------------
1 | .container {
2 | padding: 0 2rem;
3 | }
4 |
5 | .main {
6 | min-height: 100vh;
7 | padding: 4rem 0;
8 | flex: 1;
9 | display: flex;
10 | flex-direction: column;
11 | justify-content: center;
12 | align-items: center;
13 | }
14 |
15 | .footer {
16 | display: flex;
17 | flex: 1;
18 | padding: 2rem 0;
19 | border-top: 1px solid #eaeaea;
20 | justify-content: center;
21 | align-items: center;
22 | }
23 |
24 | .footer a {
25 | display: flex;
26 | justify-content: center;
27 | align-items: center;
28 | flex-grow: 1;
29 | }
30 |
31 | .title a {
32 | color: #0069f3;
33 | text-decoration: none;
34 | }
35 |
36 | .title a:hover,
37 | .title a:focus,
38 | .title a:active {
39 | text-decoration: underline;
40 | }
41 |
42 | .title {
43 | margin: 0;
44 | line-height: 1.15;
45 | font-size: 4rem;
46 | }
47 |
48 | .title,
49 | .description {
50 | text-align: center;
51 | }
52 |
53 | .description {
54 | margin: 4rem 0;
55 | line-height: 1.5;
56 | font-size: 1.5rem;
57 | }
58 |
59 | .code {
60 | background: #fafafa;
61 | border-radius: 5px;
62 | padding: 0.75rem;
63 | font-size: 1.1rem;
64 | font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
65 | Bitstream Vera Sans Mono, Courier New, monospace;
66 | }
67 |
68 | .grid {
69 | display: flex;
70 | align-items: center;
71 | justify-content: center;
72 | flex-wrap: wrap;
73 | max-width: 800px;
74 | }
75 |
76 | .card {
77 | margin: 1rem;
78 | padding: 1.5rem;
79 | text-align: left;
80 | color: inherit;
81 | text-decoration: none;
82 | border: 1px solid #eaeaea;
83 | border-radius: 10px;
84 | transition: color 0.15s ease, border-color 0.15s ease;
85 | width: 100%;
86 | }
87 |
88 | .card:hover,
89 | .card:focus,
90 | .card:active {
91 | color: #0070f3;
92 | border-color: #0070f3;
93 | }
94 |
95 | .card h2 {
96 | margin: 0 0 1rem 0;
97 | font-size: 1.5rem;
98 | }
99 |
100 | .card p {
101 | margin: 0;
102 | font-size: 1.25rem;
103 | line-height: 1.5;
104 | }
105 |
106 | .logo {
107 | height: 1em;
108 | margin-left: 0.5rem;
109 | }
110 |
111 | @media (max-width: 600px) {
112 | .grid {
113 | width: 100%;
114 | flex-direction: column;
115 | }
116 | }
117 |
118 | @media (prefers-color-scheme: dark) {
119 | .card,
120 | .footer {
121 | border-color: #222;
122 | }
123 |
124 | .code {
125 | background: #111;
126 | }
127 |
128 | .logo img {
129 | filter: invert(1);
130 | }
131 | }
132 |
--------------------------------------------------------------------------------
/vercel.json:
--------------------------------------------------------------------------------
1 | {
2 | "rewrites": [
3 | {
4 | "source": "/(.*)",
5 | "destination": "/api/proxy"
6 | }
7 | ]
8 | }
--------------------------------------------------------------------------------