engine.io
Advanced tools
Comparing version 6.5.0-alpha.1 to 6.5.0
@@ -132,3 +132,5 @@ "use strict"; | ||
this.onDataRequestCleanup(); | ||
res.end("ok"); | ||
res.cork(() => { | ||
res.end("ok"); | ||
}); | ||
}; | ||
@@ -266,6 +268,8 @@ res.onAborted(() => { | ||
this.headers(this.req, headers); | ||
Object.keys(headers).forEach((key) => { | ||
this.res.writeHeader(key, String(headers[key])); | ||
this.res.cork(() => { | ||
Object.keys(headers).forEach((key) => { | ||
this.res.writeHeader(key, String(headers[key])); | ||
}); | ||
this.res.end(data); | ||
}); | ||
this.res.end(data); | ||
callback(); | ||
@@ -272,0 +276,0 @@ }; |
@@ -52,11 +52,12 @@ "use strict"; | ||
open: (ws) => { | ||
ws.transport.socket = ws; | ||
ws.transport.writable = true; | ||
ws.transport.emit("drain"); | ||
const transport = ws.getUserData().transport; | ||
transport.socket = ws; | ||
transport.writable = true; | ||
transport.emit("drain"); | ||
}, | ||
message: (ws, message, isBinary) => { | ||
ws.transport.onData(isBinary ? message : Buffer.from(message).toString()); | ||
ws.getUserData().transport.onData(isBinary ? message : Buffer.from(message).toString()); | ||
}, | ||
close: (ws, code, message) => { | ||
ws.transport.onClose(code, message); | ||
ws.getUserData().transport.onClose(code, message); | ||
}, | ||
@@ -247,7 +248,9 @@ }); | ||
return; | ||
if (!this.statusWritten) { | ||
// status will be inferred as "200 OK" | ||
this.writeBufferedHeaders(); | ||
} | ||
this.res.end(data); | ||
this.res.cork(() => { | ||
if (!this.statusWritten) { | ||
// status will be inferred as "200 OK" | ||
this.writeBufferedHeaders(); | ||
} | ||
this.res.end(data); | ||
}); | ||
} | ||
@@ -268,2 +271,7 @@ onData(fn) { | ||
} | ||
cork(fn) { | ||
if (this.isAborted) | ||
return; | ||
this.res.cork(fn); | ||
} | ||
} |
{ | ||
"name": "engine.io", | ||
"version": "6.5.0-alpha.1", | ||
"version": "6.5.0", | ||
"description": "The realtime engine behind Socket.IO. Provides the foundation of a bidirectional connection between client and server", | ||
@@ -49,3 +49,3 @@ "type": "commonjs", | ||
"eiows": "^4.1.2", | ||
"engine.io-client": "6.4.0", | ||
"engine.io-client": "6.5.0", | ||
"engine.io-client-v3": "npm:engine.io-client@3.5.2", | ||
@@ -61,3 +61,3 @@ "expect.js": "^0.3.1", | ||
"typescript": "^4.4.3", | ||
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.15.0" | ||
"uWebSockets.js": "github:uNetworking/uWebSockets.js#v20.30.0" | ||
}, | ||
@@ -64,0 +64,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
162883
4488
0