touhidurrr / mirrorTouhidurrr

A WebProxy built with Cloudflare Workers
https://mirror.touhidur.pro
BSD 3-Clause "New" or "Revised" License
30 stars 25 forks source link

How I Build on my cloudflare pages #1

Closed JohanChungus closed 1 year ago

JohanChungus commented 1 year ago

I have a problem

touhidurrr commented 1 year ago
  1. clone the project.
  2. rename WebProxy.js to _worker.js
  3. deploy to cloudflare

see if this works

JohanChungus commented 1 year ago

still same 12:07:57.496Cloning repository...12:07:58.372From https://github.com/JohanChungus/A-Proxy-built-with-Cloudflare-Workers12:07:58.373 * branch 1f48a9aeaf8ff04268f36872943e127b14c264c0 -> FETCH_HEAD12:07:58.37312:07:58.420HEAD is now at 1f48a9a Rename WebProxy.js to _worker.js12:07:58.42012:07:58.56912:07:58.597Success: Finished cloning repository files12:08:05.318Success: Assets published!12:08:06.200Error: Failed to publish your Function. Got error: multipart uploads must contain a readable body_part or main_module

touhidurrr commented 1 year ago

@JohanChungus at present I use both Cloudflare Pages and Cloudflare Workers to host the site. WebProxy.js is uploaded to Workers with https://github.com/touhidurrr/mirrorTouhidurrr/blob/main/.github/workflows/update.yml while rest of the site is uploaded to cloudflare pages. You also need to do some setup like this: image

touhidurrr commented 1 year ago

But I guess you can modify and upload the whole site as a workers site. I will look into the possibility.

JohanChungus commented 1 year ago

Hmm I Just Clone Your Repo And Rename WebProxy.js to _worker.js and deploy on Cloudflare Its Success To Deploy But I Try Using Its Not Working https://primatama.pages.dev/

touhidurrr commented 1 year ago

Maybe because of this:

When using a _worker.js file, the entire /functions directory is ignored, including its routing and middleware characteristics. Instead, the _worker.js file is deployed and must be written using the Module Worker syntax. If you have never used Module syntax, refer to the JavaScript modules blog post to learn more. Using Module syntax enables JavaScript frameworks to generate a Worker as part of the Pages output directory contents.

https://developers.cloudflare.com/pages/platform/functions/advanced-mode/

JohanChungus commented 1 year ago

Hmm So How I Fix It?

JohanChungus commented 1 year ago

Error 1102 Ray ID: 7b3b1bxxxxxxx • 2023-04-06 15:36:49 UTCWorker exceeded resource limits

What happened?

You've requested a page on a website (a7b28433.mirrortouhidurrr-ctt.pages.dev) that is on the Cloudflare network. An unknown error occurred while rendering the page.

touhidurrr commented 1 year ago

@JohanChungus I am experimenting with _worker.js, I will update you on it when it is available inshallah.

JohanChungus commented 1 year ago

I will close the comment

touhidurrr commented 1 year ago

@JohanChungus sorry I forgot about this issue, had some issues IRL.

Anyways, today I fixed it and from now on, simply using this repo with Cloudflare Pages will make the project work fully functional.

From my tests, it works fine. Kindly test it from your side and check if it works also. Then we can close this issue as completed,.

JohanChungus commented 1 year ago

Its okay just solve your IRL issues first Its Working Great, But Most Website Block The IP

touhidurrr commented 1 year ago

Its okay just solve your IRL issues first

Well, mostly boredom and unproductiveness.

Its Working Great

Glad to know!

But Most Website Block The IP

It's not necessarily blocking. The project mostly works good with Static sites.

JohanChungus commented 1 year ago

Hmm Error 1003Ray ID: 7b9e8429400940a8 • 2023-04-18 17:09:34 UTCDirect IP access not allowed

What happened?

You've requested an IP address that is part of the Cloudflare network. A valid Host header must be supplied to reach the desired website.

What can I do?

If you are interested in learning more about Cloudflare, please visit our website.

Was this page helpful? Yes No

Thank you for your feedback!

Cloudflare Ray ID: 7b9e8429400940a8 • Your IP: Click to reveal 185.213.83.78 • Performance & security by Cloudflare