5

使用 Shadowsocks 访问 ChatGPT 频繁出现 Something Went Wrong 问题的解决方法

 1 year ago
source link: https://www.codewoody.com/posts/55697/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
Published Mar 28, 2023

使用 Shadowsocks 访问 ChatGPT 频繁出现 Something Went Wrong 问题的解决方法

由于国情原因我们使用使用 ChatGPT 需要使用各种形式的代理,这时我们肯能会发现在与 ChatGPT 对话的过程中可能会出现下面的错误:

Something went wrong. If this issue presists please contact us through our help center at help.openai.com

Something went wrong. If this issue presists please contact us through our help center at help.openai.com

这种错误一般在我们再让网页空闲一段时间(通常是一分钟)后再次提问时出现。当然,去 OpenAI 的帮助中心是不会搜到什么有用的信息的。如果你去检索这个问题,你能得到的最好答案是在出现这个页面之后刷新页面,然后回到对话窗口继续对话即可。但是刷新后如果再次出现空闲窗口的情况,这个问题会反复出现,因此你在对话中就不得不反复地刷新页面,再加上每次页面重载你都需要去勾选 Cloudflare 的机器人验证框,这就会极大程度上拖慢我们的速度,影响产品体验。

这个问题是否可能是由于我翻墙访问导致的呢?我使用的翻墙软件是 Shadowsocks,经过一番搜索,一个 Github Issue 的讨论给了我灵感。

讨论地址:https://github.com/shadowsocks/shadowsocks-libev/issues/2149

讨论地址:https://github.com/shadowsocks/shadowsocks-libev/issues/2149

尽管讨论的题目和 ChatGPT 没有直接关系,但是这个回复提到,Shadowsocks 在构建代理管道时,会在客户端使用 Privoxy 来讲 Socks5 代理转换成 http 代理,进而被浏览器使用。Privoxy 的配置中包含了 Socket 连接时长方面的控制。于是我查看了我本地的 Shadowsocks 使用的 Privoxy 的配置文件,这个文件在 MacOS 中位于 /Users/lena/Library/Application Support/ShadowsocksX-NG/privoxy.config 文件。

toggle  1
enable-remote-toggle 1
enable-remote-http-toggle 1
enable-edit-actions 0
enforce-blocks 0
buffer-limit 4096
forwarded-connect-retries 0
accept-intercepted-requests 0
allow-cgi-request-crunching 0
split-large-forms 0
keep-alive-timeout 5
socket-timeout 60

forward 192.168.*.*/ .
forward 10.*.*.*/ .
forward 127.*.*.*/ .
forward [FE80::/64] .
forward [::1] .
forward [FD00::/8] .
forward-socks5 / 127.0.0.1:1086 .

# Put user privoxy config line in this file.
# Ref: https://www.privoxy.org/user-manual/index.html

可以看到 keep-alive-timeoutsocket-timeout 这两个选项设定的超时时间都比较低。我做了下面两个尝试:

  1. 将这两个设置调高,并重启 Shadowsocks,但随后发现 Privoxy 重置了设置文件;
  2. 我手动 kill 掉正在运行的 Privoxy 并且手动使用更新后的 config 文件调起一个新的进程,但是仍然没有解决 Something went wrong 的问题;

至此,我也不想和 Privoxy 纠缠下去,既然问题出在 Socks5 代理转 Http 代理的环节,我们可以使用 Proxifier 这个软件直接使用 Shadowsocks 提供的 Socks5 代理,就可以很好地解决这个问题。

Proxifier 的教程网上非常多,我就不在这篇文章里赘述了。

Proxifier 的使用参加我的文章:如何使用 Proxifier 来进行流量代理控制


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK