NextChat icon indicating copy to clipboard operation
NextChat copied to clipboard

[Bug] PROXY_URL不支持使用密码的用户代理,解析不正确

Open WF1683497569 opened this issue 1 year ago • 7 comments

描述问题 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

WF1683497569 avatar Apr 10 '23 15:04 WF1683497569

不算是 bug,因为我没说它支持

Yidadaa avatar Apr 10 '23 18:04 Yidadaa

我查了资料,将: echo "$protocol $host $port" >> $conf; 改成: echo "$protocol $host $port $PROXY_USER $PROXY_PASSWD" >> $conf;

然后配置2个环境变量 $PROXY_USER、$PROXY_PASSWD应该就可以实现这个功能了

yinm0591 avatar Apr 11 '23 00:04 yinm0591

@WF1683497569

当前版本有1个讨巧的办法,你可以试试: -e PROXY_URL="http://127.0.0.1:7890 user pass"

yinm0591 avatar Apr 11 '23 06:04 yinm0591

需要更新 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

Yidadaa avatar Apr 11 '23 10:04 Yidadaa

同问

arvinws avatar May 26 '23 06:05 arvinws

容器里可以配置代理嘛,能实现本地不开代理也能访问到chatgpt嘛

JDxiaojuju avatar Jun 09 '23 17:06 JDxiaojuju

PROXY_URL只支持http代理而不支持socks5代理吗

peefau avatar Jun 15 '23 08:06 peefau

@WF1683497569

当前版本有1个讨巧的办法,你可以试试: -e PROXY_URL="http://127.0.0.1:7890 user pass"

感谢,能解决问题

ilolita945 avatar Jun 19 '23 10:06 ilolita945

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

Issues-translate-bot avatar Jun 19 '23 10:06 Issues-translate-bot

收录至 #2105

Yidadaa avatar Jun 23 '23 16:06 Yidadaa

Bot detected the issue body's language is not English, translate it automatically.


Included in #2105

Issues-translate-bot avatar Jun 23 '23 16:06 Issues-translate-bot