File size: 2,156 Bytes
82cb77d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Playwright 代理服务使用说明</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
            line-height: 1.6;
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
        }

        pre {
            background-color: #f5f5f5;
            padding: 15px;
            border-radius: 5px;
            overflow-x: auto;
        }

        code {
            font-family: 'Courier New', Courier, monospace;
        }
    </style>
</head>

<body>
    <h1>Playwright 代理服务</h1>

    <h2>简介</h2>
    <p>这是一个基于 Playwright 的代理服务,可以帮助你访问需要浏览器环境的网页。它使用真实的 Chromium 浏览器来渲染页面,支持 JavaScript 执行。</p>

    <h2>使用方法</h2>
    <h3>基本用法</h3>
    <p>通过在 URL 参数中指定目标网址来使用代理服务:</p>
    <pre><code>http://localhost:7860/?url=https://example.com</code></pre>

    <h3>支持的 HTTP 方法</h3>
    <ul>
        <li>GET - 获取页面内容</li>
        <li>POST - 发送表单数据或 JSON</li>
        <li>PUT - 更新资源</li>
        <li>DELETE - 删除资源</li>
        <li>其他标准 HTTP 方法</li>
    </ul>

    <h3>示例</h3>
    <p>1. 使用 curl 发送 GET 请求:</p>
    <pre><code>curl "http://localhost:7860/?url=https://example.com"</code></pre>

    <p>2. 发送 POST 请求:</p>
    <pre><code>curl -X POST "http://localhost:7860/?url=https://example.com/api" \
     -H "Content-Type: application/json" \
     -d '{"key": "value"}'</code></pre>

    <h2>注意事项</h2>
    <ul>
        <li>所有请求都会通过真实的浏览器执行,包括 JavaScript</li>
        <li>服务会保持原始响应的状态码和大部分响应头</li>
        <li>为了性能考虑,每个请求的超时时间默认为 30 秒</li>
    </ul>
</body>

</html>