V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
通过以下 Referral 链接购买 DigitalOcean 主机,你将可以帮助 V2EX 持续发展
DigitalOcean - SSD Cloud Servers
maoshummm
V2EX  ›  VPS

vps 通过 curl 可以访问 chatgpt,但通过浏览器又不能访问

  •  
  •   maoshummm · 310 天前 · 1949 次点击
    这是一个创建于 310 天前的主题,其中的信息可能已经有所发展或是发生改变。

    我通过 curl -v ttps://chat.openai.com/cdn-cgi/trace 回测的 ip 是 ipv6 的,但是浏览器又不能访问。fl=12f901 h=chat.openai.com ip=2001:470:f147:2acd::d532 ts=1687451520.188 visit_scheme=https uag=curl/7.74.0 colo=LAX sliver=none http=http/2 loc=US tls=TLSv1.3 sni=plaintext warp=off gateway=off rbi=off kex=X25519 有大佬知道原因吗

    16 条回复    2023-10-27 11:02:08 +08:00
    cxtrinityy
        1
    cxtrinityy  
       309 天前 via Android
    是指 VPS 搭的梯子,本地浏览器通过梯子访问 openai 不行? vps 是纯 v6 还是 4/6 双栈?
    maoshummm
        2
    maoshummm  
    OP
       309 天前 via iPhone
    @cxtrinityy 搬瓦工 v4 的
    cxtrinityy
        3
    cxtrinityy  
       309 天前 via Android   ❤️ 1
    那可能到了 VPS 出口走的 v4 ,你在 VPS 上用 v4 curl 试试,看看什么情况
    maoshummm
        4
    maoshummm  
    OP
       309 天前
    @cxtrinityy 我用 curl -4 -v https://chat.openai.com/cdn-cgi/trace 回测的还是 ipv6 的地址。
    fl=465f68
    h=chat.openai.com
    ip=2001:470:8096:10a4::ef5b
    ts=1687494811.513
    visit_scheme=https
    uag=curl/7.74.0
    colo=SJC
    sliver=none
    http=http/2
    loc=US
    tls=TLSv1.3
    sni=plaintext
    warp=off
    gateway=off
    rbi=off
    kex=X25519
    cxtrinityy
        5
    cxtrinityy  
       309 天前
    @maoshummm 你这个有点奇怪啊, 如果没有 v4 出口地址 curl 应该请求不通? 现在通了却返回 v6, 可能搬瓦工机房网关给你出口做了转 v6? 感觉不太可能.
    这个先不管, 你浏览器访问不了还有个可能是你本地代理没通, 或者通了但是你的浏览器流量没走代理, 你看看本地代理软件 listen 的端口, 本地用 curl -x 代理地址试试
    lns103
        6
    lns103  
       309 天前
    你看一下 nslookup chat.openai.com 的结果,可能是 VPS 提供商做了代理,自己用的话,可以用 WARP 或者 HE IPv6 Tunnel Broker ,换正常的 1.1.1.1 8.8.8.8 之类的进行解析,把流量导入隧道
    maoshummm
        7
    maoshummm  
    OP
       309 天前
    @lns103 输入命名:nslookup chat.openai.com
    Server: 172.31.255.2
    Address: 172.31.255.2#53

    Name: chat.openai.com
    Address: 172.31.255.2
    应该没有代理。
    下午试了使用:curl -x socks5://127.0.0.1:1080 https://chat.openai.com
    直接报 schannel: disabled automatic use of client certificate 这个错误。
    我在另外一台可以连接 chat.openai.com 的 vps 上是通过 curl -x socks5h://127.0.0.1:1080 https://chat.openai.com 连通的
    非常感谢
    maoshummm
        8
    maoshummm  
    OP
       309 天前
    我用 https://test-ipv6.com/index.html.zh_CN 这个网站查看
    你的公网 IPv4 地址是 74.211.104.222
    你的运营商( ISP )是 FIBER-LOGIC
    没有检测到 IPv6 地址 [更多信息]
    你只接入了 IPv4 互联网,不能访问纯 IPv6 网站。
    可向运营商咨询如何使用 IPv6 ,实现最佳的网络性能。 [更多信息]
    你的 DNS 服务器(可能由运营商提供)已经接入 IPv6 互联网了。

    但是,我通过这个 http://ipv6test.google.com/测试是没有接入 ipv6
    不清楚具体原因
    lns103
        9
    lns103  
       308 天前 via Android
    172.31.255.2 是局域网 IP ,明显是走了代理
    lns103
        10
    lns103  
       308 天前 via Android
    理论上 VPS 提供商的代理是可以访问 chatGPT 的,你看一下浏览器访问 https://chat.openai.com/cdn-cgi/trace 的结果是不是那个 ipv6 ,如果不是,那就可以在服务器上强制重新解析域名
    maoshummm
        11
    maoshummm  
    OP
       308 天前
    @lns103 vps 浏览器上间隔一段时间访问 https://chat.openai.com/cdn-cgi/trace 这个回测的 ipv6 地址都不一样与 curl 访问的也不一样
    maoshummm
        12
    maoshummm  
    OP
       307 天前
    @lns103 非常感谢,已经找到原因了,是 naiveproxy 代理的问题,换成 ss 就可以直接访问了。
    anjunecha
        13
    anjunecha  
       286 天前 via iPhone
    @maoshummm 你好,请问你后来 naiveproxy 有解决不?我现在也遇到了用 naiveproxy 无法访问 chatgpt
    maoshummm
        14
    maoshummm  
    OP
       286 天前 via iPhone
    @anjunecha 换成支持 ipv6 的代理就可以
    anjunecha
        15
    anjunecha  
       286 天前 via iPhone
    @maoshummm 谢谢指导!
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1274 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 23:51 · PVG 07:51 · LAX 16:51 · JFK 19:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.