Skip to content

7a6163/cors-proxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CORS Anywhere with Hono and Cloudflare Workers

This project demonstrates how to create a CORS Anywhere proxy using the Hono framework and deploy it on Cloudflare Workers.

Features

  • Proxy requests to bypass CORS restrictions.
  • Handles URLs passed directly in the path.
  • Supports both HTTP and HTTPS.
  • Shows usage instructions when accessed without a URL.
  • Returns a 404 for /favicon.ico requests.

Installation

  1. Clone the repository:

    git clone https://github.com/7a6163/cors-proxy
    cd cors-proxy
  2. Install dependencies:

    npm install
  3. Deploy to Cloudflare Workers:

    npm run deploy

Usage

Once deployed, you can use your CORS Anywhere proxy by passing the target URL directly in the path.

Examples

  • https://your-worker-subdomain.workers.dev/http://google.com/ - Proxies requests to Google.com with CORS headers.
  • https://your-worker-subdomain.workers.dev/google.com - Same as previous, defaults to HTTPS.
  • https://your-worker-subdomain.workers.dev/google.com:443 - Proxies https://google.com/.
  • https://your-worker-subdomain.workers.dev/ - Shows usage text.
  • https://your-worker-subdomain.workers.dev/favicon.ico - Replies with 404 Not Found.

License

This project is licensed under the MIT License.

About

CORS Anywhere with Hono and Cloudflare Workers

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published