File tree 3 files changed +10
-6
lines changed
websites/code2/studygolang
3 files changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -24,8 +24,8 @@ type WebsocketController struct {
24
24
mutex sync.Mutex
25
25
}
26
26
27
- func (this * WebsocketController ) RegisterRoute (e * echo.Group ) {
28
- e .Get ("/ws" , standard .WrapHandler (websocket .Handler (this .Ws )))
27
+ func (this * WebsocketController ) RegisterRoute (g * echo.Group ) {
28
+ g .Get ("/ws" , standard .WrapHandler (websocket .Handler (this .Ws )))
29
29
}
30
30
31
31
// websocket,统计在线用户数
Original file line number Diff line number Diff line change 203
203
{
204
204
"importpath": "github.com/polaris1119/goutils",
205
205
"repository": "https://github.com/polaris1119/goutils",
206
- "revision": "15c2eed5ef7632c6807c5b46eaf4cfc3c201d629 ",
206
+ "revision": "582c98b3184b83e1600833fb042b3ecc3070dcda ",
207
207
"branch": "master"
208
208
},
209
209
{
Original file line number Diff line number Diff line change @@ -403,12 +403,14 @@ window.WebSocket = window.WebSocket || window.MozWebSocket;
403
403
if ( window . WebSocket ) {
404
404
var websocket = new WebSocket ( wsUrl ) ;
405
405
406
- websocket . onopen = function ( ) {
406
+ websocket . onopen = function ( evt ) {
407
407
// console.log("open");
408
+ // console.log(evt);
408
409
}
409
410
410
- websocket . onclose = function ( ) {
411
+ websocket . onclose = function ( evt ) {
411
412
// console.log("close");
413
+ // console.log(evt);
412
414
}
413
415
414
416
websocket . onmessage = function ( msgEvent ) {
@@ -433,7 +435,9 @@ if (window.WebSocket) {
433
435
}
434
436
}
435
437
436
- // websocket.onerror = onError;
438
+ websocket . onerror = function ( evt ) {
439
+ // console.log(evt);
440
+ }
437
441
}
438
442
439
443
$ ( function ( ) {
You can’t perform that action at this time.
0 commit comments