File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change 4
4
5
5
Server 端使用的是 [ socket.io] ( https://socket.io ) 官方的 [ chat demo] ( https://github.com/socketio/socket.io/tree/master/examples/chat ) 源码, 部署在了 [ heroku] ( https://vast-plateau-30681.herokuapp.com/ ) 上.
6
6
7
+ > 默认使用了 Socket.io 官网版本
8
+
7
9
> 注意: 因为 Server 的地址是 ` HTTPS ` 的, 由于小程序开发版本对域名的限制, 请在` 微信开发者工具 ` -> ` 详情 ` 菜单中勾选 ` 不校验合法域名、web-view(业务域名)、TLS 版本以及 HTTPS 证书 `
8
10
9
11
<img src =" ./screenshots_1.png " width =" 50% " >
Original file line number Diff line number Diff line change @@ -227,6 +227,10 @@ Page({
227
227
this . pushMessage ( createSystemMessage ( 'reconnect_failed' ) )
228
228
} )
229
229
230
+ socket . on ( 'reconnect_attempt' , ( ) => {
231
+ this . pushMessage ( createSystemMessage ( '正在尝试重连' ) )
232
+ } )
233
+
230
234
socket . on ( 'error' , err => {
231
235
this . pushMessage ( createSystemMessage ( `error: ${ err } ` ) )
232
236
} )
You can’t perform that action at this time.
0 commit comments