使用 Cloudflare WARP 解锁 ChatGPT

使用 Vultr VPS 科学上网以后,Chatgpt API 使用没有问题,但是网页访问 chat.openai.com 仍然是 Access denied。

简单使用的话也未必一定要访问网页版,可以用 Poe 或者 OpenCat。只是我想试用一下 ChatGPT Plus 才能用的 GPT-4,不得不访问网页版。

做了一番尝试:

  1. 配置远程桌面到 VPS,在 VPS 上用浏览器访问 chat.openai.com,Access denied。

  2. 尝试在 Vultr 上创建其他地区的 VPS,试了四五个地区,仍然 Access denied。

  3. 只好谷歌一番,原来在最新的限制下,使用 ChatGPT 还得需要“原生 IP”,所谓“原生 IP ”就是指该网站的 IP 地址和其机房的 IP 地址是一致的。或者还有其他什么限制。

  4. 试试使用原生 IP,网上大致有两个解决方案:有的 VPS 厂商能提供美国原生 IP;使用 Cloudflare Warp 。

    方案一花了一些时间去搜索,最后还是放弃了,一是这些服务商名气不大,我之前也没有用过;二是万一 IP 被封了也比较麻烦;三是已经在 Vultr 付费了,不想再另起炉灶。

    于是实施一下方案二。

    参考 https://pkg.cloudflareclient.com/install

    Ubuntu 20.04 LTS 下

    curl https://pkg.cloudflareclient.com/pubkey.gpg | sudo gpg --yes --dearmor --output /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg

    echo "deb [arch=amd64 signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/cloudflare-client.list

    sudo apt update


    参考 https://developers.cloudflare.com/warp-client/get-started/linux/

    sudo apt install cloudflare-warp

    systemctl status warp-svc

    warp-cli register

    warp-cli set-mode proxy

    warp-cli connect

    warp-cli enable-always-on

    warp-cli warp-stats


    vi /usr/local/etc/v2ray/config.json

     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
    
    {
        "inbounds": [
            {
                "port": 10086, 
                "protocol": "vmess",
                "settings": {
                    "clients": [
                        {
                            "id": "09096d21-dd57-48ee-9111-38421e6a6b90"
                        }
                    ]
                }
            }
        ],
        "outbounds": [
            {
                "protocol": "freedom"
            },
            {
                "tag": "warp",
                "protocol": "socks",
                "settings": {
                    "servers": [
                        {
                            "address": "127.0.0.1",
                            "port": 40000,
                            "users": []
                        }
                    ]
                }
            }
        ],
        "routing": {
        "rules": [
            {
            "type": "field",
            "domain": [
                "openai.com",
                "ai.com"
            ],
            "outboundTag": "warp"
        }
        ]
    }
    }
    

    systemctl stop v2ray

    systemctl start v2ray


     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
    
    [email protected]:~$ curl ipinfo.io
    {
    "ip": "xxx.xxx.xxx.xxx",
    "hostname": "xxx.xxx.xxx.xxx.vultrusercontent.com",
    "city": "Piscataway",
    "region": "New Jersey",
    "country": "US",
    "loc": "40.4993,-74.3990",
    "org": "AS20473 The Constant Company, LLC",
    "postal": "08854",
    "timezone": "America/New_York",
    "readme": "https://ipinfo.io/missingauth"
    
    
    rji[email protected]:~$ curl -x "socks5://127.0.0.1:40000" ipinfo.io
    {
    "ip": "104.28.215.142",
    "city": "Willowbrook",
    "region": "New York",
    "country": "US",
    "loc": "40.6032,-74.1385",
    "org": "AS13335 Cloudflare, Inc.",
    "postal": "10314",
    "timezone": "America/New_York",
    "readme": "https://ipinfo.io/missingauth"
    

    在电脑上重启一下 V2rayU ,就可以正常访问 https://chat.openai.com/auth/login 了。


Comments: