Comments (22)
from socket.io-weapp-demo.
请务必注意: 因为 Server 的地址是 HTTPS的, 由于小程序开发版本对域名的限制, 请在微信开发者工具 -> 详情 菜单中勾选 不校验合法域名、web-view(业务域名)、TLS 版本以及 HTTPS 证书
from socket.io-weapp-demo.
from socket.io-weapp-demo.
取消勾选
from socket.io-weapp-demo.
大佬可否分享一下server 端的代码?
from socket.io-weapp-demo.
Server 端使用的是 socket.io 官方的 chat demo 源码, 可以去看看
from socket.io-weapp-demo.
from socket.io-weapp-demo.
没有任何改动吗?
from socket.io-weapp-demo.
没有的,你重新编译刷新一下
from socket.io-weapp-demo.
依然不行=_=
from socket.io-weapp-demo.
你把URL换了?是什么意思?
from socket.io-weapp-demo.
const socket = (this.socket = io( 'https://vast-plateau-30681.herokuapp.com/' ))
把这个url换成了我自己的服务器的,上面有socket.io的chat demo
from socket.io-weapp-demo.
用我的URL也不行吗?
from socket.io-weapp-demo.
完全没问题,一换就出错
from socket.io-weapp-demo.
检查一下你的 Server或者 nginx配置
from socket.io-weapp-demo.
把我的https换成http就好了,原因不明
from socket.io-weapp-demo.
我也有同样的问题,在开发工具里OK,用手机预览就提示:xhr poll error
from socket.io-weapp-demo.
from socket.io-weapp-demo.
模拟器需要勾选『不校验域名合法性』
真机需要开启 Debug 模式
from socket.io-weapp-demo.
开发者工具里,已经勾选 不校验域名合法性,并且可以正常运行。
在手机里“预览”和“远程调试”不行,您说的“真机需要开启 Debug 模式”,具体指的是什么呢?
from socket.io-weapp-demo.
from socket.io-weapp-demo.
打开调试模式后好了,谢谢。
现在有点担心的是,发布线上会不会有问题,您有没有正式项目有应用过?
from socket.io-weapp-demo.
Related Issues (2)
- 无法通过命名空间连接 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socket.io-weapp-demo.