@@ -160,7 +160,7 @@ def ws_new_connection(self, wsid, fid):
160
160
rv .created ()
161
161
return rv
162
162
163
- def tx (self , msg , conn = None , fid = None , wsid = None , bcast = False ):
163
+ def tx (self , msg , conn = None , fid = None , wsid = None , bcast = False ):
164
164
'''
165
165
Send a message via websocket to a specific browser, specific tab (wsid) or all
166
166
@@ -185,17 +185,23 @@ def tx(self, msg, conn = None, fid=None, wsid=None, bcast=False):
185
185
186
186
def ws_close (self , wsid_or_conn ):
187
187
'''
188
- Close a specific web socket from server side; perhaps because it mis-behaved .
188
+ Close a specific web socket from server side.
189
189
190
190
LUA code detects this message and kills it's connection.
191
191
'''
192
192
self .tx ('CLOSE' , wsid = getattr (wsid_or_conn , 'wsid' , wsid_or_conn ))
193
193
194
+ def ws_kill (self , conn ):
195
+ '''
196
+ Close all web sockets from server side; because user mis-behaved, and
197
+ also kill it's session on CFC. User will have to wait for javascript POW.
198
+ '''
199
+ self .tx ('KILL' , fid = conn .fid )
200
+
194
201
@setupmethod
195
202
def ws_rx_handler (self , f ):
196
203
"""
197
204
Registers a function to be called when traffic is received via web sockets
198
-
199
205
"""
200
206
self .ws_rx_handlers .append (f )
201
207
return f
0 commit comments