NextChat
NextChat copied to clipboard
[Bug] PROXY_URL不支持使用密码的用户代理,解析不正确
描述问题 PROXY_URL不支持使用密码的用户代理,如http://user:[email protected]:7890
如何复现
使用Docker执行:
docker run -d -p 3000:3000
-e OPENAI_API_KEY="sk-xxxx"
-e CODE="your-password"
-e PROXY_URL="http://user:[email protected]:7890"
yidadaa/chatgpt-next-web
截图
ubuntu@VM-16-14-ubuntu:/opt/app/chatgpt-next-web$ ./startup.sh
[+] Running 1/1
⠿ Container chat-next-web Started 0.5s
strict_chain
proxy_dns
remote_dns_subnet 224
tcp_read_time_out 15000
tcp_connect_time_out 8000
[ProxyList]
http fwei [email protected]
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains4.so
proxy fwei has invalid value or is not numeric
non-numeric ips are only allowed under the following circumstances:
chaintype == strict (true), proxy is not first in list (false), proxy_dns active (thread)
一些必要的信息
- 系统:linux
- 浏览器:-
- 版本: latest
- 部署方式:docker
不算是 bug,因为我没说它支持
我查了资料,将: echo "$protocol $host $port" >> $conf; 改成: echo "$protocol $host $port $PROXY_USER $PROXY_PASSWD" >> $conf;
然后配置2个环境变量 $PROXY_USER、$PROXY_PASSWD应该就可以实现这个功能了
@WF1683497569
当前版本有1个讨巧的办法,你可以试试: -e PROXY_URL="http://127.0.0.1:7890 user pass"
需要更新 DockerFile 的 proxy 部分,使用下列脚本:
function split() {
echo $1 | awk -F $2 '{print $1,$2}'
}
function parse_config() {
local input=$1
read protocol rest <<< "$(split $input '://')"
read userpass hostport <<< "$(split $rest '@')"
read user pass <<< "$(split $userpass ':')"
read host port <<< "$(split $hostport ':')"
echo "$protocol $host $port $user $pass"
}
parse_config $1
同问
容器里可以配置代理嘛,能实现本地不开代理也能访问到chatgpt嘛
PROXY_URL只支持http代理而不支持socks5代理吗
@WF1683497569
当前版本有1个讨巧的办法,你可以试试: -e PROXY_URL="http://127.0.0.1:7890 user pass"
感谢,能解决问题
Bot detected the issue body's language is not English, translate it automatically.
@WF1683497569
The current version has a tricky way, you can try: -e PROXY_URL="http://127.0.0.1:7890 user pass"
Thanks, can solve the problem
收录至 #2105
Bot detected the issue body's language is not English, translate it automatically.
Included in #2105