birdpack 1.0.14 → 1.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/websocket.js +11 -1
  2. package/package.json +1 -1
package/lib/websocket.js CHANGED
@@ -28,6 +28,8 @@ module.exports = class{
28
28
  })
29
29
  .on('close', () => {
30
30
  this.userOut();
31
+ this.callOut();
32
+ this.callOut = ()=>{};
31
33
  this.callback(this, 'close');
32
34
  })
33
35
  .on('error', (e) => {
@@ -226,7 +228,10 @@ module.exports = class{
226
228
  }
227
229
  });
228
230
  }
229
- start(uid){
231
+ callOut(){
232
+
233
+ }
234
+ async start(uid){
230
235
  let seckey = this.get('sec-websocket-key');
231
236
  let protocol = this.get('sec-websocket-protocol');
232
237
  let version = parseInt(this.get('sec-websocket-version') || 0);
@@ -240,6 +245,11 @@ module.exports = class{
240
245
  if(checkUser !== false){
241
246
  checkUser.userOut();
242
247
  checkUser.stop();
248
+ await new Promise((resolve)=>{
249
+ checkUser.callOut = ()=>{
250
+ resolve();
251
+ };
252
+ });
243
253
  }
244
254
 
245
255
  this.uid = uid;
package/package.json CHANGED
@@ -3,6 +3,6 @@
3
3
  "description": "BirdPack web framework is a tool for web server via TCP HTTP supporting websocket focusing on speed.",
4
4
  "author":"R938",
5
5
  "license":"R938",
6
- "version":"1.0.14",
6
+ "version":"1.0.15",
7
7
  "main": "index.js"
8
8
  }