【干货】【图文教学】docker部署心得分享,半小白的学习笔记,手机+电脑国内服部署
shangaokun opened this issue · comments
docker怎么安装什么的就不讲了,这块都没接触过难度就太大了。
一、命令部署docker服务
海外服务器
# 运行容器 监听8080 端口
docker run -d -p 8080:8080 --name go-proxy-bingai --restart=unless-stopped adams549659584/go-proxy-bingai
如果8080被占用了,就换其他端口,例如:
# 运行容器 监听9999端口
docker run -d -p 9999:8080 --name go-proxy-bingai --restart=unless-stopped adams549659584/go-proxy-bingai
国内服务器
国内服务器不能直连,所以一定要先配socks,我是部署了clash服务器,找了一个梯子机场花钱买了账号来映射的。
部署教程:https://parrotsec-cn.org/t/linux-clash-dashboard/5169/4
机场用的闪电猫(这块就不细说了,可以私聊shangaokun@qq.com)
然后clash搞定后,用带socks的命令来部署docker,clash的端口是7891我已经改了。
docker run -e Go_Proxy_BingAI_SOCKS_URL=【你的clash IP】:7891 -e Go_Proxy_BingAI_SOCKS_USER=xxx -e Go_Proxy_BingAI_SOCKS_PWD=xxx -d -p 8080:8080 --name go-proxy-bingai --restart=unless-stopped adams549659584/go-proxy-bingai
我默认的没配置socks用户密码,端口号是9999,就直接:
docker run -e Go_Proxy_BingAI_SOCKS_URL=【你的clash IP】:7891 -d -p 9999:8080 --name go-proxy-bingai --restart=unless-stopped adams549659584/go-proxy-bingai
二、nginx配置
因为必须是https协议,所以还需要搞一个域名、整个ssl证书来用,我半小白只会用宝塔linux管理工具。
第一步就是域名映射
我去我买域名的服务商配置了域名映射,将bing.域名.com映射到我的服务器上
配置ssl证书
宝塔站点管理中添加一个站点,并把域名配置进去,然后宝塔的管理web界面里面可以直接申请ssl,一键申请部署爽歪歪
配置端口转发
在宝塔的网站配置文件中添加转发的,添加位置就在第一个location {}的前面:
注意下面的代码中必须把X-Forwarded-XX这些配置进去
我添加了三个转发,一个转发/sydney/ChatHub,一个“/”转发所有服务,但是不知道为什么js不转发,我又加了一个js/css的转发,我看有人的issues提到有些js访问不到,可能是这个问题,建议都加一个转发。
下面的端口什么的大家结合自己清空替换一下了
location /sydney/ChatHub {
proxy_pass http://127.0.0.1:9999;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
#将所有请求转发给bing_pool池的应用处理
location / {
proxy_pass http://127.0.0.1:9999;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
#配置静态资源 解决js css文件无法加载无法访问的问题,注意末尾不能有 /
location ~ .*\.(js|css|jpg|jpeg|gif|png|ico|pdf|txt)$ {
proxy_pass http://127.0.0.1:9999;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
三、不用插件直接用
因为原来的bing网站不能直连wss协议了,需要选择第二个或者第三个自己的站点来访问。选择以后会慢一些,可以不用插件直接访问。
四、使用浏览器插件
转发速度确实慢很多,之前的版本我安装过浏览器插件了,速度较快。我还是继续用这种方式。
电脑访问
原来到这一步就可以直接通过https的域名访问了,最近不行了,按照大佬的说法,配置一个X-Forwarded-For
# 修改的头部
X-Forwarded-For:1.64.33.87
# filter request url
wss://sydney.bing.com/sydney/ChatHub
手机访问
手机浏览器大部分都不支持插件,没办法修改,推荐大家用猴狐浏览器,可以加载插件,一样的修改X-Forwarded-For就行
最后添加完成以后右上角...展开,勾选以下选项:
大佬,我是香港腾讯云服务器,该怎么部署啊?可以不用socks吗?
不用socks的话怎么部署啊?
香港服务器应该不用搭梯子配置socks的,但是我不知道bing有没有限制香港。因为我搭梯子时候ChatGPT组只有**美国之类的节点可以选,香港的都没有。我建议你还是当做国内服务器处理试试。
…
---原始邮件--- 发件人: @.> 发送时间: 2023年5月25日(周四) 中午1:56 收件人: @.>; 抄送: @.@.>; 主题: Re: [adams549659584/go-proxy-bingai] 【干货】【图文教学】docker部署心得分享,半小白的学习笔记,手机+电脑国内服部署 (Issue #71) 大佬,我是香港腾讯云服务器,该怎么部署啊?可以不用socks吗? — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
大佬那韩国服务器需要socks吗?
小白求问为啥要nginx,一定要加域名吗
感觉X-Forwarded-For的值设置成4.2.2.2速度更快
感觉X-Forwarded-For的值设置成4.2.2.2速度更快
我换了没什么感觉
感谢分享经验
新版配置参考
location /sydney/ChatHub {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
新版配置参考
location /sydney/ChatHub { proxy_pass http://127.0.0.1:8080; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Port $server_port; } location / { proxy_pass http://127.0.0.1:8080; proxy_set_header Host $host; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-Host $host; proxy_set_header X-Forwarded-Port $server_port; }
感谢大佬,已经更新,分享文档也调整了
docker 部署我什么是1.8.1而不是1.8.3。
使用GO编译,如果自定义变量登录cookit
好家伙,你们配置了X-Forwarded-For都能用了?我的还是不行,还是链接wss://sydney.bing.com/sydney/ChatHub失败
好家伙,你们配置了X-Forwarded-For都能用了?我的还是不行,还是链接wss://sydney.bing.com/sydney/ChatHub失败
新版本部署以后一来有选择聊天服务设置,可以通过自己服务器来转发,不用连接wss://sydney.bing.com/sydney/ChatHub,如果你升级的记得docker pull xxx 一下,感觉你没升级成功。
2023/06/01 07:12:51 [emerg] 1#1: unknown "connection_upgrade" variable
nginx: [emerg] unknown "connection_upgrade" variable
提示找不到这个变量什么鬼,难道必须本机部署吗
你的nginx版本比较老,不支持这个变量,把配置中的这条注释掉即可
...
---原始邮件--- 发件人: @.> 发送时间: 2023年6月1日(周四) 下午3:14 收件人: @.>; 抄送: @.@.>; 主题: 回复: [adams549659584/go-proxy-bingai] 【干货】【图文教学】docker部署心得分享,半小白的学习笔记,手机+电脑国内服部署 (问题 #71) 2023/06/01 07:12:51 [新兴] 1#1:未知的“connection_upgrade”变量 nginx:[新兴]未知的“connection_upgrade”变量 提示找不到这个变量什么鬼,难道必须本机部署吗 — 直接回复此电子邮件,在 GitHub 上查看或取消订阅。 您收到此消息是因为您创作了线程。消息 ID: @.***>
我删了这行后配置确实保存成功了,输入域名时也是出现https开头了,网页名字也是BingAi,但还是卡在三个蓝点上,读不进去。。。美国的服务器
发一下f12控制台的错误信息看看
…
---原始邮件--- 发件人: @.> 发送时间: 2023年6月1日(周四) 下午4:41 收件人: @.>; 抄送: @.@.>; 主题: Re: [adams549659584/go-proxy-bingai] 【干货】【图文教学】docker部署心得分享,半小白的学习笔记,手机+电脑国内服部署 (Issue #71) 我删了这行后配置确实保存成功了,输入域名时也是出现https开头了,网页名字也是BingAi,但还是卡在三个蓝点上,读不进去。。。美国的服务器 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
把代码换成楼主的那个长代码(3个location)后可以了,后面有个短代码(2个location)的就不行。我在宝塔面板里面,nginx最高也只有1.24的。请问一下,你的nginx是什么版本的啊?
费半天劲在自己的美国服务器上面部署了,结果还是得用浏览器插件才能使用使用newbing的引擎。。。话说这个时间啥的是无限制的吗?我之前听说必须要用cookie来着
访问域名出现 Connection ID required是什么原因
访问域名出现 Connection ID required是什么原因
那个浏览器插件,你搞了没有?
你的nginx版本比较老,不支持这个变量,把配置中的这条注释掉即可
…
---原始邮件--- 发件人: @.> 发送时间: 2023年6月1日(周四) 下午3:14 收件人: @.>; 抄送: @.@.>; 主题: Re: [adams549659584/go-proxy-bingai] 【干货】【图文教学】docker部署心得分享,半小白的学习笔记,手机+电脑国内服部署 (Issue #71) 2023/06/01 07:12:51 [emerg] 1#1: unknown "connection_upgrade" variable nginx: [emerg] unknown "connection_upgrade" variable 提示找不到这个变量什么鬼,难道必须本机部署吗 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
我问newbing,他的回答在下面,是不是没用socke的就不用这行代码?外国服务器就不用这行代码?我现在用着好像还正常
这个错误是因为你没有定义$connection_upgrade变量,这个变量是用来根据$http_upgrade变量来决定是否升级为WebSocket连接的12。你需要在nginx配置文件的http块中添加一个map块来定义这个变量,如下所示32:
map $http_upgrade $connection_upgrade { default upgrade; ‘’ close; }
然后你就可以用这个变量来设置Connection字段了。
用了
换了个端口,又出现了此站点的连接不安全
解决 nginx 启动报错问题:nginx: [emerg] unknown "connection_upgrade" variable
wss 通信需要用到这个参数,直接删除会导致 wss 连接失败
需要在 http 块中添加下面的代码(http 块一般在 nginx.conf 文件)
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
2023/06/01 07:12:51 [emerg] 1#1: unknown "connection_upgrade" variable nginx: [emerg] unknown "connection_upgrade" variable 提示找不到这个变量什么鬼,难道必须本机部署吗
nginx 配置的 http 块中 加上以下 map;
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
比较小白的问题,用Nginx Proxy Manager怎么配置,每次打开都要等半天才出来,一直有打印
WebSocket connection to 'wss://sydney.bing.com/sydney/ChatHub' failed:
WebSocket connection to 'wss://sydney.vcanbb.chat/sydney/ChatHub' failed:
还有就是怎么配置本站才能用,我用的是美国vps
大佬,我就想局域网内用用,https那里该如何解决?
大佬,我就想局域网内用用,https那里该如何解决?
局域网自签证书。自己生成一下就ok....
大佬,我是香港腾讯云服务器,该怎么部署啊?可以不用socks吗?
好麻烦 还是直接用chatgpt 吧 https://ai.zhaoyeqing.cn
https也配置好了,海外服务器Docker compose部署的,页面能打开但发送问题后一直卡在“很抱歉,似乎出现错误。让我们重新开始吧。”,折腾好久终于好了。
解决办法:
点击右上角菜单选择最后一项“一键重置”,之后就好用了……
请问配置socket代理服务器,target: 'ws://' ,目标服务器填写什么啊?
想在海外服务器上部署个代理,把服务部署在国内通过代理访问
httpProxy.createServer({ target: 'ws://XXX:xxx', ws: true }).listen(8888);
我在国内的一个linux服务器上运行了 ./go-proxy-bingai
,然后配置好nginx (如下配置),使用 https 访问,但还是不行,提示 Sorry, looks like your network settings are preventing access to this feature.
. 需要服务器可以科学上网么?
server {
listen 80;
server_name xxx.xxx.xxx;
location /sydney/ChatHub {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
}
server {
listen 443 ssl;
server_name xxx.xxx.xxx;
ssl_certificate xxx/fullchain.pem;
ssl_certificate_key xxx/privkey.pem;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3;
location /sydney/ChatHub {
proxy_pass http://127.0.0.1:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
location / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
}
msedge_LLUm35SUdI.mp4
Go_Proxy_BingAI_SOCKS_URL=【你的clash IP】:7891 -e Go_Proxy_BingAI_SOCKS_USER=xxx -e Go_Proxy_BingAI_SOCKS_PWD=xxx -d -p 8080:8080 --name go-proxy-bingai --restart=unless
docker 运行的这个 env 环境变量就是配置网络代理...国内服务器自然需要科学才行....
Go_Proxy_BingAI_SOCKS_URL=【你的clash IP】:7891 -e Go_Proxy_BingAI_SOCKS_USER=xxx -e Go_Proxy_BingAI_SOCKS_PWD=xxx
Go_Proxy_BingAI_SOCKS_URL=【你的clash IP】:7891 -e Go_Proxy_BingAI_SOCKS_USER=xxx -e Go_Proxy_BingAI_SOCKS_PWD=xxx -d -p 8080:8080 --name go-proxy-bingai --restart=unless
docker 运行的这个 env 环境变量就是配置网络代理...国内服务器自然需要科学才行....
Go_Proxy_BingAI_SOCKS_URL=【你的clash IP】:7891 -e Go_Proxy_BingAI_SOCKS_USER=xxx -e Go_Proxy_BingAI_SOCKS_PWD=xxx
国内服务器自然需要科学才行? 那还是的需要一个可以代理国外网络的服务(器) 才行喽,有没有不需要梯子国内可直接使用的方式方法呢?
我试了部署在vercel上,其生成的url,类似于 https://go-proxy-bingai-xxx.vercel.app/ 国内也访问不了?
请问是需要https就行还是必须有域名+https?我再国内服务器按照步骤走完始终卡在三个点,我梯子都从ssr换到了clash,确定都是能访问外网的,但是我看docker始终提示我代理出错,不知道到底问题出在了哪里,我现在只有不是域名这一个问题,但是域名需要备案很麻烦,我用海外服务器用ip+https就能部署完成,这个代理问题我没想明白是不是这个域名的问题
浏览器插件是怎么操作?有详细的教程吗。
国内服务器使用clash会被封吗?
加个^~通配符就解决问题了
location ^~ / {
proxy_pass http://127.0.0.1:8080;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Port $server_port;
}
[bing]
wss_link = "wss://newbing.ai.domain.com/sydney/ChatHub"
会话创建的接入点
bing_endpoint = "https://newbing.ai.domain.com/edgesvc/turing/conversation/create"
出现错误:
出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚会话” 来回溯到上一条对话,你上一条说的我就当作没看见。
'adaptiveCards'
出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚会话” 来回溯到上一条对话,你上一条说的我就当作没看见。
'messages'
感觉大佬的 bingai.xiao-gy.tk 的bing可以用,版本1.11.15可以用,但是GitHub的fork 部署的还是老版本,需要每个客户端更新登录bing并且复制cookie才能用,[Harry-zklcdc]大佬,更新一下v1.11.15代码吧!