This Cloudflare Worker acts as a proxy to dynamically fetch and display content from a specified website within the worker's domain.
- Proxy Functionality: Fetches content from a target website and displays it within the worker.
- URL Rewriting: Rewrites URLs in the fetched content to ensure they point correctly to the worker's domain.
- CORS Support: Adds CORS headers to allow cross-origin requests.
-
Cloudflare Account:
- Ensure you have a Cloudflare account set up.
-
Cloudflare Workers:
- Go to the Cloudflare dashboard and navigate to Workers.
-
Create a New Worker:
- Create a new worker and paste the provided script.
-
Configuration:
- Open the script and replace
'example.com'with the domain of the website you want to proxy. This should be done in the following line:const targetHost = 'example.com'; // Replace with the target website
- Open the script and replace
-
Deploy:
- Save and deploy your worker.
- Access your Cloudflare Worker URL to see the proxied content of the target website.
- Respect the terms of service and usage policies of the target website.
- Ensure compliance with data protection and privacy regulations.
Contributions are welcome! Please fork this repository and submit a pull request with your improvements.
This project is licensed under the MIT License.