CORS 代理

基于 EdgeOne Pages 边缘函数的免费 CORS 代理服务

🎯 在线测试

边缘计算

全球边缘节点运行

🔒

安全可控

域名黑名单 + 请求头过滤

🚀

低延迟

就近接入,快速代理

📖 使用说明

// GET 请求 - 通过 url 参数指定目标地址
GET /proxy?url=https://api.example.com/data

// POST 请求 - 转发请求体
POST /proxy?url=https://api.example.com/data
Content-Type: application/json

// 支持 GET / POST / PUT / PATCH / DELETE 方法
提示:url 参数需经过 encodeURIComponent() 编码,避免特殊字符导致解析错误。

💻 Web 开发接入

在任意前端项目中,通过本代理绕过浏览器 CORS 限制,访问第三方 API:

// 原始请求(会被 CORS 拦截) const res = await fetch('https://api.example.com/data'); // 通过代理请求 const proxyUrl = `https://cros.123x.fun/proxy?url=${encodeURIComponent(targetUrl)}`; const res = await fetch(proxyUrl); const data = await res.json(); // POST 请求示例 const res = await fetch(proxyUrl, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ key: 'value' }), });
import axios from 'axios'; // 通过代理发送 GET 请求 const proxyUrl = `https://cros.123x.fun/proxy?url=${encodeURIComponent(targetUrl)}`; const { data } = await axios.get(proxyUrl); // 通过代理发送 POST 请求 const { data } = await axios.post(proxyUrl, { key: 'value', });
const proxyUrl = `https://cros.123x.fun/proxy?url=${encodeURIComponent(targetUrl)}`; const xhr = new XMLHttpRequest(); xhr.open('GET', proxyUrl); xhr.setRequestHeader('Content-Type', 'application/json'); xhr.onload = () => { const data = JSON.parse(xhr.responseText); console.log(data); }; xhr.send();
// Vue 3 组合式 API 示例 import { ref } from 'vue' const PROXY = 'https://cros.123x.fun/proxy?url=' const data = ref(null) async function fetchData(targetUrl) { const res = await fetch(PROXY + encodeURIComponent(targetUrl)) data.value = await res.json() }
安全提示:本代理已屏蔽对内网地址(localhost、127.0.0.1、云元数据地址)的访问,防止 SSRF 攻击。