{"id":25174992,"url":"https://github.com/alula/cf-workers-media-proxy","last_synced_at":"2025-08-19T08:38:22.729Z","repository":{"id":276348659,"uuid":"901099745","full_name":"alula/cf-workers-media-proxy","owner":"alula","description":"A fast, simple image media proxy written in Rust that runs on Cloudflare Workers.","archived":false,"fork":false,"pushed_at":"2024-12-10T03:29:52.000Z","size":16,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-16T22:23:13.182Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"zlib","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alula.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-10T03:28:50.000Z","updated_at":"2025-07-25T18:06:02.000Z","dependencies_parsed_at":"2025-02-07T17:51:42.405Z","dependency_job_id":"de491fd5-1902-46b0-a2ba-368190489b4f","html_url":"https://github.com/alula/cf-workers-media-proxy","commit_stats":null,"previous_names":["alula/cf-workers-media-proxy"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alula/cf-workers-media-proxy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alula%2Fcf-workers-media-proxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alula%2Fcf-workers-media-proxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alula%2Fcf-workers-media-proxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alula%2Fcf-workers-media-proxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alula","download_url":"https://codeload.github.com/alula/cf-workers-media-proxy/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alula%2Fcf-workers-media-proxy/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271123151,"owners_count":24703174,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-19T02:00:09.176Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-09T12:28:36.408Z","updated_at":"2025-08-19T08:38:22.704Z","avatar_url":"https://github.com/alula.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Cloudflare Workers Next.js Media Proxy\n\nA fast, simple image media proxy written in Rust that runs on Cloudflare Workers.\n\n## Features\n\n- Supports passthrough of SVG images\n- Supports PNG, JPEG, and WebP images\n- Supports lossy and lossless WebP images\n- Passes through ICC color profiles embedded inside images\n\n## Usage\n\nTo use the media proxy, make a request to the following endpoint:\n\n```\n/{base64url-encoded-url}?{query-parameters}\n```\n\n### Supported Query Parameters\n\n- `q`: Quality (0-100, default: 85)\n- `w`: Max width (default: `DEFAULT_MAX_WIDTH`)\n- `h`: Max height (default: `DEFAULT_MAX_HEIGHT`)\n- `f`: Format (png, jpeg, webp)\n\n### Example\n\n```sh\ncurl \"https://your-cloudflare-worker-url/$(echo -n 'https://example.com/image.jpg' | basenc --base64url)?w=800\u0026h=600\u0026q=90\u0026f=webp\"\n```\n\n## Integration with Next.js\n\nTo integrate the media proxy with Next.js, you must add a custom image loader that generates the correct URL for the media proxy.\n\nExample implementation:\n\n```javascript\n'use client'\n \nexport default function cfWorkerImageLoader({ src, width, quality }) {\n    const base64Url = btoa(src).replace('+','-').replace('/','_').replace('=','');\n    return `https://your-cloudflare-worker-url/${base64Url}?w=${width}\u0026f=webp${quality ? '\u0026q=' + quality : ''}`;\n}\n```\n\n## Configuration\n\n1. Copy `wrangler.toml.example` to `wrangler.toml`:\n\n```sh\ncp wrangler.toml.example wrangler.toml\n```\n\n2. Set the allowed domains in `wrangler.toml`:\n\n```toml\n[vars]\nDOMAIN_WHITELIST = \"example.com,anotherdomain.com\"\n```\n\n3. Deploy the worker:\n\n```sh\nnpx wrangler deploy\n```\n\n## License\n\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falula%2Fcf-workers-media-proxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falula%2Fcf-workers-media-proxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falula%2Fcf-workers-media-proxy/lists"}