File tree Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Expand file tree Collapse file tree 3 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -64,7 +64,7 @@ function jwt() {
64
64
}
65
65
66
66
$ ( document ) . ready ( function ( ) {
67
- var ws = null ;
67
+ var ws = null , meta = null ;
68
68
69
69
$ ( '#channel' ) . keyup ( updateJWT ) ;
70
70
updateJWT ( ) ;
@@ -74,6 +74,10 @@ $(document).ready(function () {
74
74
if ( ws === null ) {
75
75
var jwt = $ ( '#jwt' ) . val ( ) ;
76
76
var channel = $ ( '#channel' ) . val ( ) ;
77
+
78
+ meta = createWebSocket ( '/server-info/' + jwt ) ;
79
+ meta . onmessage = onMessage ( '#meta-messages' ) ;
80
+
77
81
if ( channel == "" ) {
78
82
ws = createWebSocket ( '/' + jwt ) ;
79
83
} else {
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ <h2>Chat</h2>
34
34
< h2 > Messages sent to chat channel</ h2 >
35
35
< div id ="messages ">
36
36
</ div >
37
+ < h2 > Messages sent to meta channel</ h2 >
38
+ < div id ="meta-messages ">
39
+ </ div >
37
40
</ div >
38
41
</ div >
39
42
</ body >
Original file line number Diff line number Diff line change @@ -91,16 +91,16 @@ wsApp Context{..} pendingConn =
91
91
validClaims
92
92
ctxGetTime
93
93
94
+ case configMetaChannel ctxConfig of
95
+ Nothing -> pure ()
96
+ Just ch -> sendNotification " Connecion Open" ch
97
+
94
98
when (hasRead mode) $
95
99
forM_ chs $ flip (onMessage ctxMulti) $ WS. sendTextData conn . B. payload
96
100
97
101
when (hasWrite mode) $
98
102
notifySession conn sendNotification chs
99
103
100
- case configMetaChannel ctxConfig of
101
- Nothing -> pure ()
102
- Just ch -> sendNotification " Connecion Open" ch
103
-
104
104
waitForever <- newEmptyMVar
105
105
void $ takeMVar waitForever
106
106
You can’t perform that action at this time.
0 commit comments