Comparing version 3.4.1 to 3.4.2
{ | ||
"name": "eiows", | ||
"version": "3.4.1", | ||
"version": "3.4.2", | ||
"description": "custom fork of uWebSockets 0.14", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -13,4 +13,6 @@ eiows is a replacement module for ws which allows, but doesn't guarantee, significant performance and memory-usage improvements. This module is specifically only compatible with Node.js. | ||
Example: | ||
Examples: | ||
If you use engine.io version 5.0.0 or higher: | ||
var fs = require('fs'); | ||
@@ -29,2 +31,27 @@ var https = require('https'); | ||
var io = require("socket.io")(server, { | ||
wsEngine: require("eiows").Server, | ||
perMessageDeflate: { | ||
threshold: 32768 | ||
} | ||
}); | ||
io.on("connection", function(socket) { | ||
console.log('Yes, you did it!'); | ||
}); | ||
If you use engine.io version 3.4.2 till version 5.0.0: | ||
var fs = require('fs'); | ||
var https = require('https'); | ||
var ssl_options = { | ||
key: fs.readFileSync('server.key'), | ||
cert: fs.readFileSync('server.crt'), | ||
}; | ||
var server = https.createServer(ssl_options); | ||
server.listen(1443); | ||
var io = require("socket.io")(server, { | ||
wsEngine: 'eiows', | ||
@@ -40,3 +67,2 @@ perMessageDeflate: { | ||
Have fun! |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
8197947
66