GithubHelp home page GithubHelp logo

可以部署在cf上吗? about bingo HOT 19 CLOSED

SokWith avatar SokWith commented on May 25, 2024
可以部署在cf上吗?

from bingo.

Comments (19)

weaigc avatar weaigc commented on May 25, 2024

这个项目与NewBingGoGo-Web的实现原理有什么差异吗? 是重写前端,调用可代理访问官网的后端服务器来实现的吧? 目前NBGoGo的前端是放在github上,后端直接用的cf的workes,可以很好工作。 但由于作者没有精力跟进前端功能开发,项目基本停摆了。

这个项目原理基本相似,应该也可以直接在cf上部署后端,github上部署前端吧?
@SokWith
我先把todo搞完,cf考虑到有被封锁,可能要看一下还存在哪些问题。hf也是免费的呀,不考虑吗

from bingo.

weaigc avatar weaigc commented on May 25, 2024

@SokWith 考虑到封锁原因,不考虑支持直接支持 workers,不过已支持 cloudflare workers 域名转发,README.md 有更新,你可以试试。

from bingo.

SokWith avatar SokWith commented on May 25, 2024

@SokWith 考虑到封锁原因,不考虑支持直接支持 workers,不过已支持 cloudflare workers 域名转发,README.md 有更新,你可以试试。

谢谢。

from bingo.

SokWith avatar SokWith commented on May 25, 2024

作者,你好。
能不能把你这个项目 如何获取 https://www.bing.com/turing/conversation/create 的返回头文件/cookie 的代码用 cf的workers来实现,或者能不能解释一下代码是如何处理的流程图?就是要如何创建哪些头文件项目后去fetch官方的这个网址以获得聊天句柄?
我发现你这个项目确实不需要cookie就可以默认展开聊天,头文件的创建方式似乎有所不同

请见谅我没有多少代码能力,只能拿来主义

Harry-zklcdc/go-proxy-bingai#138 (comment)

from bingo.

weaigc avatar weaigc commented on May 25, 2024

作者,你好。 能不能把你这个项目 如何获取 https://www.bing.com/turing/conversation/create 的返回头文件/cookie 的代码用 cf的workers来实现,或者能不能解释一下代码是如何处理的流程图?就是要如何创建哪些头文件项目后去fetch官方的这个网址以获得聊天句柄? 我发现你这个项目确实不需要cookie就可以默认展开聊天,头文件的创建方式似乎有所不同

请见谅我没有多少代码能力,只能拿来主义

Harry-zklcdc/go-proxy-bingai#138 (comment)
@SokWith 我这边的原理是: /api/create 转发请求到 https://www.bing.com/turing/conversation/create ,这就需要转发的服务部署在美国机房,如 HF 上。

from bingo.

SokWith avatar SokWith commented on May 25, 2024

Harry-zklcdc/go-proxy-bingai#138 (comment)

from bingo.

weaigc avatar weaigc commented on May 25, 2024

@SokWith 我明白你的意思了,这个我后面加了个 workers 脚本吧,先标记一下。

from bingo.

weaigc avatar weaigc commented on May 25, 2024

@SokWith 封锁升级了,cf workers 就算部署了目前也没有办法正常使用,计划暂时只能取消。

from bingo.

SokWith avatar SokWith commented on May 25, 2024

好的,谢谢

from bingo.

weaigc avatar weaigc commented on May 25, 2024

@SokWith 这个是 proxy 代码 https://github.com/weaigc/bingo/blob/feature/cf-proxy/cloudflare/proxy.js

from bingo.

SokWith avatar SokWith commented on May 25, 2024

@SokWith 这个是 proxy 代码 https://github.com/weaigc/bingo/blob/feature/cf-proxy/cloudflare/proxy.js

谢谢。我粗略理解这个是聊天的代理吧?需要配合前端来工作的吧?
bing这个项目,现在根本的问题是如何create一个有效的conversationId吧,目前隔壁代理情况看,只有转发成微软的IP才管用了。

from bingo.

SokWith avatar SokWith commented on May 25, 2024

@weaigc 大佬,你那个cf workers上的proxy.js是不是可以做WS_ENDPOINT用?能不能再改写一个可以部署在其它平台的代码,专门用作WS_ENDPOINT服务器以应对官方对WSS服务器的封控?主要是cf 上的WS_ENDPOINT不能匿名访问的。

from bingo.

weaigc avatar weaigc commented on May 25, 2024

@weaigc 大佬,你那个cf workers上的proxy.js是不是可以做WS_ENDPOINT用?能不能再改写一个可以部署在其它平台的代码,专门用作WS_ENDPOINT服务器以应对官方对WSS服务器的封控?主要是cf 上的WS_ENDPOINT不能匿名访问的。
@SokWith
其实可以部署在任意平台,你可以看一下这个 https://github.com/weaigc/bingo/blob/532df35440f4e99b38f136c54db9400dd4bdddd6/cloudflare/worker.js

from bingo.

SokWith avatar SokWith commented on May 25, 2024

谢谢。只是不是很明白,里面的TARGET_HOST后台服务器是只提供前端界面吗?看代码里面似乎有wss转发那就用不上TARGET_HOST后台服务器做wss转发吧?

另外,cf workers的代码不是标准node.js代码吧?不能直接用在其他平台上吧?

from bingo.

weaigc avatar weaigc commented on May 25, 2024

谢谢。只是不是很明白,里面的TARGET_HOST后台服务器是只提供前端界面吗?看代码里面似乎有wss转发那就用不上TARGET_HOST后台服务器做wss转发吧?

另外,cf workers的代码不是标准node.js代码吧?不能直接用在其他平台上吧?

可以用 cli.js 启动

from bingo.

SokWith avatar SokWith commented on May 25, 2024

谢谢。只是不是很明白,里面的TARGET_HOST后台服务器是只提供前端界面吗?看代码里面似乎有wss转发那就用不上TARGET_HOST后台服务器做wss转发吧?
另外,cf workers的代码不是标准node.js代码吧?不能直接用在其他平台上吧?

可以用 cli.js 启动

谢谢。折腾了许久才发现cli是虚拟加载到了本地网络,与期望的远程部署完全相反,不能作为WSS节点使用。

from bingo.

weaigc avatar weaigc commented on May 25, 2024

谢谢。只是不是很明白,里面的TARGET_HOST后台服务器是只提供前端界面吗?看代码里面似乎有wss转发那就用不上TARGET_HOST后台服务器做wss转发吧?
另外,cf workers的代码不是标准node.js代码吧?不能直接用在其他平台上吧?

可以用 cli.js 启动

谢谢。折腾了许久才发现cli是虚拟加载到了本地网络,与期望的远程部署完全相反,不能作为WSS节点使用。

你部署在哪就可以使用哪里的网络

from bingo.

SokWith avatar SokWith commented on May 25, 2024

谢谢。只是不是很明白,里面的TARGET_HOST后台服务器是只提供前端界面吗?看代码里面似乎有wss转发那就用不上TARGET_HOST后台服务器做wss转发吧?
另外,cf workers的代码不是标准node.js代码吧?不能直接用在其他平台上吧?

可以用 cli.js 启动

谢谢。折腾了许久才发现cli是虚拟加载到了本地网络,与期望的远程部署完全相反,不能作为WSS节点使用。

你部署在哪就可以使用哪里的网络

部署的是上面你那个有WSS转发的worker.js哟,不是main下的全站转发的js代码,后者只是反代而已,前者是相当于部署wss代理服务器。但我在多个云商里面cli处理出来的都是变成了本地网络访问官服造成失败。不过后来我问了一下bing,让它给了我一份node.js的代码,部署在render和huggingface上都ok的。

const httpProxy = require('http-proxy');
const proxy = httpProxy.createProxyServer({});

proxy.on('proxyReq', function(proxyReq, req, res, options) {
  proxyReq.setHeader('Origin', 'https://www.bing.com');
});

const serverUrl = 'sydney.bing.com';

const server = require('http').createServer(function(req, res) {
  proxy.web(req, res, {
    target: 'wss://' + serverUrl,
    ws: true,
    changeOrigin: true
  });
});

server.on('upgrade', function(req, socket, head) {
  proxy.ws(req, socket, head, {
    target: 'wss://' + serverUrl,
    changeOrigin: true
  });
});

server.listen(7860);

from bingo.

weaigc avatar weaigc commented on May 25, 2024

谢谢。只是不是很明白,里面的TARGET_HOST后台服务器是只提供前端界面吗?看代码里面似乎有wss转发那就用不上TARGET_HOST后台服务器做wss转发吧?
另外,cf workers的代码不是标准node.js代码吧?不能直接用在其他平台上吧?

可以用 cli.js 启动

谢谢。折腾了许久才发现cli是虚拟加载到了本地网络,与期望的远程部署完全相反,不能作为WSS节点使用。

你部署在哪就可以使用哪里的网络

部署的是上面你那个有WSS转发的worker.js哟,不是main下的全站转发的js代码,后者只是反代而已,前者是相当于部署wss代理服务器。但我在多个云商里面cli处理出来的都是变成了本地网络访问官服造成失败。不过后来我问了一下bing,让它给了我一份node.js的代码,部署在render和huggingface上都ok的。

const httpProxy = require('http-proxy');
const proxy = httpProxy.createProxyServer({});

proxy.on('proxyReq', function(proxyReq, req, res, options) {
  proxyReq.setHeader('Origin', 'https://www.bing.com');
});

const serverUrl = 'sydney.bing.com';

const server = require('http').createServer(function(req, res) {
  proxy.web(req, res, {
    target: 'wss://' + serverUrl,
    ws: true,
    changeOrigin: true
  });
});

server.on('upgrade', function(req, socket, head) {
  proxy.ws(req, socket, head, {
    target: 'wss://' + serverUrl,
    changeOrigin: true
  });
});

server.listen(7860);

原理一样的,之所以后面取消这个功能是因为 cf,replit,还有deno都被微软封锁了,留着没多大意义就下了

from bingo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.