通用 HTTP 代理 — API 转发、网页抓取、图片代理、SSE 流式透传
| mode | 返回 | 用途 |
|---|---|---|
raw (default) | JSON: {success, status, headers, body} | API 调用(POST)/ 透传(GET) |
passthrough | 原始响应透传 | 图片、二进制、<img src> |
stream | 流式透传(自动检测 SSE) | LLM streaming |
llm | JSON: {title, description, content} | 网页正文提取 |
fetch('https://proxy.link2web.site', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
url: 'https://api.example.com/data',
method: 'GET',
headers: { 'Authorization': 'Bearer token' },
mode: 'raw'
})
})
// 透传
fetch('https://proxy.link2web.site?url=https://example.com')
// 正文提取
fetch('https://proxy.link2web.site?url=https://example.com&mode=llm')
// 图片代理
<img src="https://proxy.link2web.site?url=https://example.com/img.jpg&mode=passthrough" />