Giter Site home page Giter Site logo

Comments (7)

Crawler995 avatar Crawler995 commented on May 30, 2024

@cheerryio 目前我是这样设置的:客户端使用React自带的跨域功能(即package.json中应该有个proxy字段),那个proxy字段应该设置的是localhost:3001,也就是客户端运行在localhost:3000去跨localhost:3001(也就是服务器地址),我觉得或许与这个有关。你把server放服务器上了,客户端去跨localhost:3001的域就找不到服务器了。
如果需要将server运行在服务器上,可以将客户端打包放在server的资源路径下面然后加点代码,这样就像访问普通网页一样,输入域名即可打开管理中心,也可以顺便避免跨域问题。

from douyubarrage-pro.

cheerryio avatar cheerryio commented on May 30, 2024

我已经将web中package.json的proxy字段改为 http://我的域名:3001。并将web中所有出现localhost:3000的地方更改为 我的域名:3000,以便能够正常利用跳转网页。将web中为了与后端进行连接的websocket连接地址改为了 我的域名:3001。 现在进入主界面,下方卡片一直在旋转加载。进入房间,显示服务器连接成功,但是主播信息的component一直在旋转加载。我也并不能找到在哪里可以控制开始抓取弹幕和停止抓取弹幕。
QQ截图20200623151855
QQ图片20200623151834

from douyubarrage-pro.

Crawler995 avatar Crawler995 commented on May 30, 2024

@cheerryio 你懂浏览器控制台吗?你可以看看网络请求,看具体的问题是啥,是404还是服务端报错等等。这个暴露的问题是http接口出问题了,所以加载不出来主播基本情况。

from douyubarrage-pro.

cheerryio avatar cheerryio commented on May 30, 2024

我的所有网络请求并没有出现404或者502(包括ALL中和XHR中的所有请求)。具体情况你可以访问一下 www.baobao.pink:5000 查看一下。(并且我发现点开某些XHR的请求连接,都会跳到 / 这个路径下的页面

from douyubarrage-pro.

Crawler995 avatar Crawler995 commented on May 30, 2024

@cheerryio 我觉得是你后来加在服务器里面的路由代码出问题了 /api的请求返回的是html页面 本来是应该返回json数据的 你检查一下

from douyubarrage-pro.

dfaofeng avatar dfaofeng commented on May 30, 2024

这是前端没连上后端吧,f12看下控制台那个api报错

from douyubarrage-pro.

cheerryio avatar cheerryio commented on May 30, 2024

通过在package.json设置proxy字段实现对/api的匹配代理只有在Development Mode下有效。所有只有直接写上 ajax的请求路径 http://域名:3001/api........那么就要自己解决这个跨域问题了。。
令,能不能实现即使断开socket连接爬取也不停止的版本~~~~
感谢开源,我将关闭这个Issue。

from douyubarrage-pro.

Related Issues (17)

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.