惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
SegmentFault 最新的问题
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Attack and Defense Labs
Attack and Defense Labs
F
Full Disclosure
Vercel News
Vercel News
N
News | PayPal Newsroom
The GitHub Blog
The GitHub Blog
H
Hacker News: Front Page
H
Heimdal Security Blog
P
Privacy International News Feed
博客园 - 司徒正美
Google DeepMind News
Google DeepMind News
N
Netflix TechBlog - Medium
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
Cisco Blogs
L
Lohrmann on Cybersecurity
D
Docker
Recent Announcements
Recent Announcements
Security Archives - TechRepublic
Security Archives - TechRepublic
人人都是产品经理
人人都是产品经理
C
CXSECURITY Database RSS Feed - CXSecurity.com
P
Proofpoint News Feed
T
Tailwind CSS Blog
C
Check Point Blog
博客园 - 叶小钗
Google Online Security Blog
Google Online Security Blog
Martin Fowler
Martin Fowler
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
S
Secure Thoughts
博客园 - Franky
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
P
Palo Alto Networks Blog
Latest news
Latest news
量子位
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
博客园 - 三生石上(FineUI控件)
The Cloudflare Blog
Last Week in AI
Last Week in AI
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Cyberwarzone
Cyberwarzone
小众软件
小众软件
Cisco Talos Blog
Cisco Talos Blog
Hacker News: Ask HN
Hacker News: Ask HN
T
Threatpost
T
Tenable Blog
P
Privacy & Cybersecurity Law Blog
WordPress大学
WordPress大学

WishMeLz - Linux

目标域名在线测试 - WishMeLz NodeBB 搭建安装笔记 v4.x - WishMeLz puppeteer在Linux端 依赖库确实 libdrm.so.2,libnss3.so Linux 工具箱整理 - WishMeLz docker 镜像加速 - WishMeLz Certimate 使用教程 - WishMeLz ip自签名ssl证书 - WishMeLz PM2搭配nvm使用不同版本Node启动项目 - WishMeLz shell脚本备份数据库 - WishMeLz
cors-anywhere Nodejs实现静态资源代理,使用ESA加速访问 - WishMeLz
WishMeLz · 2026-06-01 · via WishMeLz - Linux

解决前端访问静态资源CORS跨域的问题 https://github.com/WishMelz/cors-anywhere 【添加只允许代理静态资源条件判断】;原仓库:https://github.com/Rob--W/cors-anywhere

此仓库代码仅仅帮忙解决前端下载CORS资源问题,请勿非法使用!!!

举个使用场景:html2canvas、Fabric.js、Three.js 等前端库在把外部图片绘制到 <canvas> 时,若目标服务器未返回 Access-Control-Allow-Origin:*,浏览器会抛出 CORS 错误。

1、快速使用(公共实例)

https://cors.xzxo.cn/<资源URL>
https://cors.xzxo.cn/https://i0.kym-cdn.com/photos/images/original/000/798/744/f10.gif
https://cors.xzxo.cn/https://raw.githubusercontent.com/WishMelz/file/refs/heads/master/image/93120923874f9477d30035b76d9978e0.jpg

GitHub 文件测试
https://raw.githubusercontent.com/WishMelz/file/refs/heads/master/image/93120923874f9477d30035b76d9978e0.jpg

2、搭建

服务启动

git clone https://github.com/WishMelz/cors-anywhere.git
cd cors-anywhere
npm i 
pm2 start server.js  // 默认端口是8080

nginx配置

location ^~ / {
    proxy_pass http://127.0.0.1:8080;
    proxy_set_header Host $http_host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Real-Port $remote_port;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Host $host;
    proxy_set_header X-Forwarded-Port $server_port;
    proxy_set_header REMOTE-HOST $remote_addr;
    
    proxy_connect_timeout 60s;
    proxy_send_timeout 600s;
    proxy_read_timeout 600s;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection $connection_upgrade;
}

ESA配置

2025-08-06T16:48:27.png

来一把全球PING

2025-08-06T16:56:46.png

合规声明

本项目仅供合法解决前端 CORS 下载问题使用。禁止用于绕过版权、非法抓取、接口攻击等行为。使用者须遵守目标站点 robots.txt 及当地法律法规,违者后果自负。


最后编辑时间为: August 7th , 2025 at 12:57 am
本文由 Wish 创作,采用 知识共享署名 4.0 国际许可协议进行许可
可自由转载、引用,但需署名作者且注明文章出处

标签 : 无标签