mirror of
https://github.com/ciiiii/cloudflare-docker-proxy.git
synced 2025-12-06 14:42:51 +08:00
Compare commits
3 Commits
yscai/fix-
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f0b9200de | ||
|
|
c7ca5c64f9 | ||
|
|
c595a14166 |
@@ -1,5 +1,14 @@
|
||||
# cloudflare-docker-proxy
|
||||
|
||||
> ### ⚠️ **Important Notice**
|
||||
> <span style="color:#d73a49;font-weight:bold">Docker Hub is rate-limiting Cloudflare Worker IPs, causing frequent <code>429</code> errors.</span>
|
||||
> <span style="color:#d73a49;font-weight:bold">This project is currently NOT recommended for production use.</span>
|
||||
|
||||
|
||||
Due to the current instability, this project is not recommended for production use.
|
||||
We will provide updates as soon as more information becomes available.
|
||||
|
||||
|
||||

|
||||
|
||||
[](https://deploy.workers.cloudflare.com/?url=https://github.com/ciiiii/cloudflare-docker-proxy)
|
||||
|
||||
3023
package-lock.json
generated
Normal file
3023
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -14,7 +14,7 @@
|
||||
"scripts": {
|
||||
"format": "prettier --write '**/*.{js,css,json,md}'",
|
||||
"build": "webpack",
|
||||
"dev": "wrangler dev src/index.js --env dev"
|
||||
"dev": "npx wrangler dev src/index.js --env dev"
|
||||
},
|
||||
"license": "MIT",
|
||||
"main": "src/index.js"
|
||||
|
||||
@@ -32,6 +32,9 @@ function routeByHosts(host) {
|
||||
|
||||
async function handleRequest(request) {
|
||||
const url = new URL(request.url);
|
||||
if (url.pathname == "/") {
|
||||
return Response.redirect(url.protocol + "//" + url.host + "/v2/", 301);
|
||||
}
|
||||
const upstream = routeByHosts(url.hostname);
|
||||
if (upstream === "") {
|
||||
return new Response(
|
||||
@@ -154,7 +157,7 @@ async function fetchToken(wwwAuthenticate, scope, authorization) {
|
||||
}
|
||||
|
||||
function responseUnauthorized(url) {
|
||||
const headers = new(Headers);
|
||||
const headers = new Headers();
|
||||
if (MODE == "debug") {
|
||||
headers.set(
|
||||
"Www-Authenticate",
|
||||
|
||||
Reference in New Issue
Block a user